I have upgraded to Cakephp 3.4 and now doing my code migrations. I modified my email functions to the following:
$email->setTemplate('welcome', 'registration')
->setSubject($subject)
->setEmailFormat('html')
->setTo($toEmail)
->setFrom($fromEmail)
->send();
But the emails are being sent without any templates. However, if I change it back to
$email->template('welcome', 'registration')
then the emails are again sent with template. The setTemplate() function doesn't seem to be working for me. Can anybody please help me figure out what I am missing.
Edit: The html file is located at src/Template/Email/html/welcome.ctp and the layout is located at src/Template/Layout/Email/html/registration.ctp