Created
May 21, 2021 13:08
-
-
Save bennettblack/7685c80814e48595e1bf80bfe0bf0579 to your computer and use it in GitHub Desktop.
Listener, that applies header to outgoing emails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Listeners; | |
use Illuminate\Mail\Events\MessageSending; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Queue\InteractsWithQueue; | |
class ApplyMailHeader | |
{ | |
/** | |
* Solves the issue of email senders having the '='and 'on behalf of' text in outlook. | |
**/ | |
/** | |
* Create the event listener. | |
* | |
* @return void | |
*/ | |
public function __construct() | |
{ | |
// | |
} | |
/** | |
* Handle the event. | |
* | |
* @param MessageSending $event | |
* @return void | |
*/ | |
public function handle(MessageSending $event) | |
{ | |
$headers = $event->message->getHeaders(); | |
$headers->addTextHeader('sender', 'txkoutdoors.com'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment