Closed empresarrollo closed 7 years ago
Setting a global to
in your config will override any other mail address already set before. According to the code you should only use this for local development.
// If a global "to" address has been set, we will set that address on the mail
// message. This is primarily useful during local development in which each
// message should be delivered into a single mail address for inspection.
if (isset($this->to['address'])) {
$this->setGlobalTo($message);
}
Setting a global to in your config will override any other mail address already set before. According to the code you should only use this for local development.
Yeah, I'm using for development, and testing that sparkpost works ok. But setting to
also put that address in CC and BCC (although I'm not using that).
Description:
When using "Universal TO" in config/mail.php:
and using MAIL_DRIVER=log, or smtp, or sparkpost, Laravel put your "universal to" also on the CC and BCC fields of the email. Then you end up with 3 copies of the same mail.
Steps To Reproduce:
return (new MailMessage)->subject('Invoice Paid')->markdown('mail.invoice.paid');
$user = App\User->create(...........)
$user->notify((new InvoicePaid($invoice));
using MAIL_DRIVER=log you would see the folowing in laravel.log:
with log everything is OK, but if you use smtp or sparkpost to test the emails you and up with triple the mails.