This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

davemcl
davemcl

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?

alxy
alxy

Are you using the newest version of October? Did you modify anything?

davemcl
davemcl

Downloaded wizard install yesterday, can send system emails fine just not ones I create. Might try a composer based install...

davemcl
davemcl

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.php

Barfs on Mail::send('test.support', $data, function($message) use ($vars){

$message->to($vars['email'], $vars['name']);

});

davemcl
davemcl

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

kuba.markiewicz17483
kuba.markiewicz17483

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

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.