Created
January 13, 2015 21:00
-
-
Save Sleavely/653aae0c85c9e1fcbc20 to your computer and use it in GitHub Desktop.
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 | |
$errand = foo(); | |
$order = bar(); | |
// Email the customer a receipt | |
$mail = Mail::send('returns.emails.approved', array('data' => 'to', 'the' => 'view'), function($message) use ($errand, $order) | |
{ | |
// The "use" keyword allows us to access external variables in our anonymous function | |
$message | |
->to($order['customer_email'], $order['customer_firstname'].' '.$order['customer_lastname']) | |
->subject(Lang::get('returns.email.subject', array('returnid' => $errand->increment_id.'#'.$errand->id))); | |
// Categorize email for Mandrill | |
$headers = $message->getHeaders(); | |
$headers->addTextHeader('X-MC-Tags', 'returns'); | |
$headers->addTextHeader('X-MC-Track', 'opens,clicks_all'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment