Skip to content

Instantly share code, notes, and snippets.

@stefro
Last active February 1, 2017 19:04
Show Gist options
  • Save stefro/5aafdf04c98bbc652fe4ada7f1cc0fe9 to your computer and use it in GitHub Desktop.
Save stefro/5aafdf04c98bbc652fe4ada7f1cc0fe9 to your computer and use it in GitHub Desktop.
Laravel Mailable that sends a custom id to reference webhook to Mailgun
<?php
/**
* Build the message.
*
* @return $this
*/
public function build()
{
return $this->markdown('emails.email-verification')
->subject('verify your email address')
->withSwiftMessage(function ($message) {
$message->getHeaders()
->addTextHeader('X-Mailgun-Variables', json_encode([
'type' => 'verification',
'id' => 'our_unique_id'
]));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment