Last active
July 18, 2018 21:16
-
-
Save motsmanish/223a44eb99c098da0419c64004a46c6a to your computer and use it in GitHub Desktop.
Render email template in library for passing email body as a paramenter in CakePHP 3. (needed this for SendGrid)
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
$template = 'dump'; | |
$layout = false; | |
$view = new View(new \Cake\Network\Request, new \Cake\Network\Response); | |
foreach ($vars as $key => $value) { | |
$view->set($key, $value); | |
} | |
$view->viewPath = 'Email\html'; \\src\Template\Email\html | |
$view_output = $view->render($template, $layout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment