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

forums7529
forums7529

Hi,

I've followed the example within the following page, placing my view file at plugins/author/plugin/views/mail/message.htm but every time I try to send an email, it throws an exception 'View [author.plugin:mail.message] not found.'.

https://octobercms.com/docs/services/mail#mail-layouts

I'm using the following code to send the email:-

Mail::send('author.plugin:mail.message', Input::all(), function($message) {

Could anyone please suggest what I might be doing wrong or confirm whether the documentation is correct ?

Many thanks in advance.

forums7529
forums7529

Managed to solve this.

That was way more complicated than it should been !

che15004
che15004

Any chance you could share your ridiculously complicated solution? I have the exact same issue.

che15004
che15004

Ok, for anyone else landing here-

You need to register the view by adding the following to your Plugin.php file

public function registerMailTemplates() { return [ 'author.plugin::mail.message' => 'My template description.', ]; }

Note the double set of colons ::

Then you can use it like this

`Mail::send('author.plugin::mail.message' , $vars, function($message) {

});`

Last updated

1-4 of 4

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