微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

addgod/laravel-mandrill-template 的正确实现

如何解决addgod/laravel-mandrill-template 的正确实现

我正在尝试发送一封电子邮件,其中包含我拥有的 mandrill 模板和“addgod / laravel-mandrill-template”库。 (Laravel 7.x) 但是当我发送电子邮件时,我什么也没收到,但我也没有错误

我的实施方式是否正确?

另外:我的密钥已经在 .env 中

谢谢!

代码

public function mandrillmail()
{
    $template = new Template('demo-template'); //This is the name of my template in mandrill
    $message = new Message();
    $message
        ->setSubject('Demo email')
        ->setFromEmail('from@mail.com')
        ->setFromName('John Doe')
        ->setMergeVars(['welcome' => 'Welcome,this is a line.']);

    $message->addRecipient(new Recipient('to@mail.com','Example Name',Type::TO));

    MandrillTemplateFacade::send($template,$message);
}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。