[英]How to return the email template with data as raw html in cakephp3.6?
嗨,大家好,我在這里有使用模板發送電子郵件的代碼,我想將模板作為原始html返回。 我該如何實現?
$email = new Email();
$email
->template('changelogrequest')
->emailFormat('html')
->subject($subject)
->to($to)
->from($this->from)
->viewVars($data);
// get raw html here
// Log::debug($email->getLayout());
$email->send();
send()方法返回包含原始html的電子郵件信息數組。 感謝Greg Schmidt。
$html = email->send();
Log::debug($html)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.