This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
If I create a new email template and hit test I get the following An exception has been thrown during the rendering of a template ("Object of class Illuminate\Mail\Message could not be converted to string") followed by the text of the template. Same result if I try and send from php section of a page. Any ideas why?
Downloaded wizard install yesterday, can send system emails fine just not ones I create. Might try a composer based install...
Same issue if using a composer based install. Error is: "An exception has been thrown during the rendering of a template ("Object of class Illuminate\Mail\Message could not be converted to string") in "
A support email from: {{name}}
Email: {{email}}
Message: {{message}}
" at line 4." on line 294 of C:\Apache24\htdocs\simpleform\vendor\twig\twig\lib\Twig\Template.phpBarfs on Mail::send('test.support', $data, function($message) use ($vars){
$message->to($vars['email'], $vars['name']);
});
Got this working in the end.
First the editor was creating twig vars like this {{ subject }}
Then I had to remove any vars called {{email}}
or {{message}}
and it all started working.
Last updated
Thanks davemcl for your solution, I had the same problem and you saved me a few hours of investigation. I would never think, that you can not use {{email}} and {{message}} in mail template.
1-6 of 6