ubermanu / magento2-email
用于发送 Magento 2 邮件模板的命令行工具
v1.3.2
2022-03-11 16:09 UTC
Requires
- magento/module-email: >=100 <102
- symfony/yaml: >= 4
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。