ubermanu/magento2-email

用于发送 Magento 2 邮件模板的命令行工具

安装次数: 1,975

依赖项: 0

建议者: 0

安全: 0

星标: 4

关注者: 4

分支: 2

开放问题: 0

类型:magento2-module

v1.3.2 2022-03-11 16:09 UTC

This package is auto-updated.

Last update: 2024-09-11 22:03:10 UTC


README

使用控制台命令根据可用的模板生成电子邮件。

安装

composer require ubermanu/magento2-email

使用方法

列出可用的邮件模板

php bin/magento email:list

生成并发送电子邮件

php bin/magento email:send \
    --template customer_create_account_email_template \
    --store 0 \
    test@domain.com

生成电子邮件并输出其内容

php bin/magento email:dump \
    --template customer_create_account_email_template \
    --store 0

变量

可以使用 YAML 文件在生成的电子邮件中注入变量。

例如

customer:
  id: 1
  name: John Doe
  email: john@example.com
  rp_token: 123456789

并在电子邮件中使用这些数据

php bin/magento email:send \
    --template customer_create_account_email_template \
    --vars variables.yaml \
    test@domain.com

注意

电子邮件应根据指定的商店语言进行翻译。

如果启用前端编译,则无法发送电子邮件。
Emogrifier 如果未先正确编译为 CSS,将无法解析生成的 HTML。