Closed martinpiria closed 4 years ago
send
should be top level option, not nested in an object, see https://github.com/forwardemail/email-templates#basic
Changed it but still doesn't work, the receiving email box doesn't get the message? Feels like I'm missing configuration from the sending email server
you have to configure a transport, see nodemailer docs
I can see how to use nodemailer
but how do i use that with email-templates
?
Is this it?
let transporter = nodemailer.createTransport({
host: "smtp.ethereal.email",
port: 587,
secure: false, // true for 465, false for other ports
auth: {
user: testAccount.user, // generated ethereal user
pass: testAccount.pass, // generated ethereal password
},
});
new Email({
message: { from: 'asd@dasda.com' },
send: true,
views: { root },
transport: transporter,
});
Thank you!
This is how we did it for 365.
get transport() {
return nodemailer.createTransport({
service: 'Outlook365',
auth: {
user: "FROM@DOMAIN.AI",
pass: "pass",
},
});
}
async init() {
const root = path.join(__dirname, 'emails');
this.Email = new Email({
message: { from: this.from },
send: true,
views: { root },
transport: this.transport,
});
return this;
// this.repsonse = await this.send(); // DEV ONLY
}
plus we had to do some configs in 365
I configured it the following way:
The preview is being shown but the email not being sent to the mailbox, is there any configurations missing from the email server's side?