var email = require('keystone-email');
require('dotenv').config();
new email('mail.pug', {
transport: 'mailgun',
}).send({
apiKey: process.env.APIKEY,
domain: process.env.MAILGUN_URL,
to: process.env.MAIL_RECEIVER,
from: {
name: 'Website',
email: 'website@mail.com',
},
subject: 'Your first KeystoneJS email',
}, function (err, result) {
if (err) {
console.error('🤕 Mailgun test failed with error:\n', err);
} else {
console.log('📬 Successfully sent Mailgun test with result:\n', result);
}
});
Hi,
I am having troubles making this helper work.
I followed the instructions on this page but when I run
node mailthe console outputs nothing and no mail is sent.It seems that I configured everything properly, mailgun included (apikey, server url, authorized recipients).
Here is my code :
Any hint on this one?