Render Template issue I've got a plugin which am triggering emails from (listening to the users.onSaveUser event).

I am using a conditional to send two emails, depending on the permissions of the person registering the user.

In one instance am using $email-&gt;htmlBody = craft()-&gt;templates-&gt;render('emails/employee', $vars); which works fine.

However, in another instance am using $email-&gt;htmlBody = craft()-&gt;templates-&gt;render('emails/prospect', $vars); and getting the following error:

Unable to find the template “emails/prospect”.


Any ideas why this might be happening or how to get more useful feedback?
I have double and triple-checked the spelling of the files and they are indeed available in the file system:
The template path needs to include your plugin folder name. So in your case the path to your email templates would be pluginname/templates/emails/prospect and the path you pass to render() would be pluginname/emails/prospect.

More info: Plugin template paths explained

But that doesn't explain why the first template path appears to work.

I’d probably keep the templates inside my plugin if they weren’t being used from the front-end. However, if you'd like to change the default template path to your front-end template directory this answer will help.