我有一个laravel 5应用程序,需要通过sendinblue服务发送重置密码链接。如何在PasswordBroker.php中更改核心功能以使用sendinblue?
public function emailResetLink(
CanResetPasswordContract $user,
$token,
Closure $callback = null
) {
$mailin = new Mailin(
'https://api.sendinblue.com/v2.0',
'0TYSSJBSKERNDKW'
);
$view = $this->emailView;
return $this->mailer->send(
$view,
compact('token', 'user'),
function($m) use ($user, $token, $callback)
{
$m->to($user->getEmailForPasswordReset());
if ( ! is_null($callback))
{
call_user_func($callback, $m, $user, $token);
}
});
}发布于 2016-05-31 00:12:04
你有没有尝试将Sendinblue添加为邮件驱动程序?此github存储库可以提供帮助(https://github.com/agence-webup/laravel-sendinblue)
在这里,您的所有电子邮件都将由Sendinblue发送,您将作为普通邮件在Laravel (https://laravel.com/docs/5.1/mail)中发送。
如果只是为了这个,你可以只为这种邮件更换驱动程序,我认为你可以像这样在运行时更换驱动程序
Config::set('mail.driver', 'driver_name');
(new Illuminate\Mail\MailServiceProvider(app()))->register(); 此外,您可以尝试侦听在发送邮件消息之前触发的'mailer.sending‘事件,但这不是一个好方法。
https://stackoverflow.com/questions/37465829
复制相似问题