So I'm using Laravel 5.1 and trying to integrate with Mailgun. Well, that's easy, but now I'm trying to send custom variables from my application along with my emails.
I'm actually switching our application over from Mandrill because of their "new direction" and such. With them, I could supply the variables and tags via the email headers, but with Mailgun, that only works when you send via SMTP. In Laravel, Mail::send()
uses an API call, so in theory I'd add the metadata there with "v:my-custom-data" => "{"this_id": 123}"
, but I'd like to avoid altering core classes like that.
I also considered using Bogardo/Mailgun, but then I'd have to replace all the Mail::send()
s with Mailgun::send()
, and then I couldn't send emails locally (environment based email driver), and then the application would be "married" to Mailgun.
Anyone done this before? Please let me know if I'm not clear here.