【问题标题】:Want to send email template through custom button click in magento2想要通过在 magento2 中单击自定义按钮发送电子邮件模板
【发布时间】:2022-01-08 13:43:06
【问题描述】:

我在销售订单视图上创建了一个自定义按钮。现在想通过该按钮在 magento2 中单击发送自定义电子邮件模板。请帮忙。

【问题讨论】:

  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: magento2


【解决方案1】:

如何在 Magento 2 中发送电子邮件

  1. 声明您的电子邮件模板 要声明与您的扩展程序一起使用的自定义电子邮件模板,请创建文件 /etc/email_templates.xml。

在我们的示例中:Magentest/AbandonedCart/etc/email_templates.xml

示例代码:

<config 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="abandonedcart_item1"
              label="Abandoned Cart Item 1"
              file="abandonedcart_item1.html"
              type="html"
              module="Magenest_AbandonedCart"
              area="frontend"
    />
</config>

详细答案可以在here找到。

【讨论】:

  • 我正在使用它,但是当我在控制器中调用助手时,它给出了构造函数错误。请帮忙
  • 此错误表明您在控制器中初始化错误或缺少构造函数。如果你只是分享你的代码,也许我可以帮助你
  • 谢谢。你的建议对我很有帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-03-10
  • 1970-01-01
  • 2011-08-04
  • 2011-11-14
  • 1970-01-01
  • 2018-01-20
  • 2014-08-08
相关资源
最近更新 更多