Skip to content

Instantly share code, notes, and snippets.

@aikchun
Forked from simkimsia/DoSomethingEmail.php
Last active December 24, 2015 12:38
Show Gist options
  • Save aikchun/6798608 to your computer and use it in GitHub Desktop.
Save aikchun/6798608 to your computer and use it in GitHub Desktop.
public function successfulSomething($data) {
$email = $this->email;
$email->subject('You have successfully done something:' . $data['title']);
$email->template('successful_done');
// This is outdated
// $email->sendAs = 'text';
$email->emailFormat('html'); // This will allow the view to use html tags to be reflected in the email.
$email->viewVars(array('data' => $data); // set multiple variables into email view.
if (EMAIL_ON) {
$result = $email->send();
} else {
$result = $email;
}
return $result;
}
Hi <?php echo $full_name; ?>,
You have successfully done something: <?php echo $title; ?>.
Share the good news about <?php echo Router::url('/'); ?>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment