Skip to content

Instantly share code, notes, and snippets.

@simkimsia
Last active December 24, 2015 11:19
Show Gist options
  • Save simkimsia/6789971 to your computer and use it in GitHub Desktop.
Save simkimsia/6789971 to your computer and use it in GitHub Desktop.
send email using cake templates
public function successfulSomething($data) {
$email = $this->email;
$email->subject('You have successfully done something:' . $data['title']);
$email->template('successful_done');
$email->sendAs = 'text';
$email->viewVars($data);
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('/'); ?>.
@aikchun
Copy link

aikchun commented Oct 2, 2013

Unable to use html tables tags using this method. Please advise again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment