0

这是我的第一个问题,如果我完全愚蠢,请原谅。

我有一个 Mautic 安装,我的电子邮件是由 cronjobs 发送的。奇迹般有效。

我需要立即发送一些特定的消息,并且我正在尝试破解一些代码来做到这一点。

我注意到当您向自己发送测试电子邮件时,您可以立即发送电子邮件。我试图通过事件监听器复制这种行为但没有成功。

一切正常,我可以捕获事件并对其进行操作,更改消息中的所有内容等,但我无法更改系统发送消息的方式。

有人知道怎么做吗?

提前致谢。

4

1 回答 1

0

我自己想通了。总而言之,在事件监听器中,我只需要将邮件程序“克隆”到示例邮件程序中。这是一个代码示例:

$temporaryMailer = (new MailerHelper())->getSampleMailer();
$temporaryMailer->setEmail($entity); // you can obtain this from the getEmail() method from the event
$temporaryMailer->setTo('recipients');
$temporaryMailer->send();
于 2018-03-20T15:41:27.660 回答