forked from cachethq/cachet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CachetHQ/Cachet/cachethq#3102 add List-Unsubscribe header
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Cachet. | ||
* | ||
* (c) Alt Three Services Limited | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace CachetHQ\Cachet\Bus\Handlers\Events; | ||
|
||
/** | ||
* This class is called immediately before sending a message into the mail channel. | ||
* | ||
* @author Graham Campbell <[email protected]> | ||
* @author James Brooks <[email protected]> | ||
*/ | ||
class MessageSending | ||
{ | ||
/** | ||
* Handle the any actions that need storing. | ||
* | ||
* @param \Illuminate\Mail\Events\MessageSending $event | ||
* | ||
* @return void | ||
*/ | ||
public function handle($event) | ||
{ | ||
if ($unsubscribeUrl = $event->data['unsubscribeUrl'] ?? null) { | ||
$event->message->getHeaders()->addTextHeader('List-Unsubscribe', '<'.$unsubscribeUrl.'>'); | ||
} | ||
} | ||
} |
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