Issue
This is below email code working file
$email = new CakeEmail('smtp');
$fromConfig = EMAIL_FROM_ADDRESS;
$fromNameConfig = EMAIL_FROM_NAME;
$email->from(array( $fromConfig => $fromNameConfig));
$email->sender(array( $fromConfig => $fromNameConfig));
$email->to($this->data['Subscribe']['email']);
$email->subject('Newsletter Confirmation');
$email->template('subscribe');
$email->emailFormat('html');
my above code taking default.ctp layout file by default(app\View\Layouts\Emails\html\default.ctp), it's fine.
But my question is i have created a other fancy.ctp layout file(app\View\Layouts\Emails\html\fancy.ctp) not use default.ctp layout file
How to use this fancy.ctp layout file in Email
Solution
I have solved issue myself......... Below my working code
$email = new CakeEmail('smtp');
$fromConfig = EMAIL_FROM_ADDRESS;
$fromNameConfig = EMAIL_FROM_NAME;
$email->from(array( $fromConfig => $fromNameConfig));
$email->sender(array( $fromConfig => $fromNameConfig));
$email->to($this->data['Subscribe']['email']);
$email->subject('Newsletter Confirmation');
$email->template('subscribe','fancy');
$email->emailFormat('html');
Answered By - thecodedeveloper.com Answer Checked By - Mary Flores (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.