Last active
December 24, 2015 11:19
-
-
Save simkimsia/6789971 to your computer and use it in GitHub Desktop.
send email using cake templates
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
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; | |
} |
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
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
Unable to use html tables tags using this method. Please advise again.