Fixes for multi-mailer gmail implementation

This commit is contained in:
David Bomba 2021-02-17 13:21:47 +11:00
parent 76f57387dc
commit c3f157717f

View File

@ -42,12 +42,14 @@ class GmailTransport extends Transport
public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = null)
{
/*We should nest the token in the message and then discard it as needed*/
/* For some reason the Injected Mail class carries cached tokens, so we need to reinit the Mail class*/
$this->gmail = null;
$this->gmail = new Mail;
/*We should nest the token in the message and then discard it as needed*/
$token = $message->getHeaders()->get('GmailToken')->getValue();
$message->getHeaders()->remove('GmailToken');
$message->getHeaders()->remove('UserId');
$this->beforeSendPerformed($message);