balderdashy / sails-hook-email

Sails email hook
67 stars 34 forks source link

Can not define a custom template #16

Closed leosuncin closed 9 years ago

leosuncin commented 9 years ago

When I use a custom template name on email hook, as you see next

sails.hooks.email.send('welcome',templateData, mailOptions, cb);

Throws this error error: Error: ENOENT, open 'views/emailTemplates/welcome/html.ejs', I would expect 'views/emailTemplates/welcome.ejs'

Post data: can you add compatibility to use promise? as:

sails.hooks.email.send(template, data, options).then(function(result) {
// Some code here
}).catch(function(err) {
// Error handling here
})
sgress454 commented 9 years ago

I would expect 'views/emailTemplates/welcome.ejs'

Please see the documentation on templates.

Post data: can you add compatibility to use promise?

Sounds like a good PR for somebody... :)

leosuncin commented 9 years ago

Is there a way to use a different template of by default? for some case use welcome.ejs instead of html.ejs