Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview shown but email not being sent #402

Closed
martinpiria opened this issue Sep 2, 2020 · 5 comments
Closed

Preview shown but email not being sent #402

martinpiria opened this issue Sep 2, 2020 · 5 comments

Comments

@martinpiria
Copy link

I configured it the following way:

const email = new Email({
    message: {  
        from: 'donotreply@edwardshavens.com'
    },
    options: {
        send: true
    },
    transport: {
        jsonTransport: true
    }
});

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?

@niftylettuce
Copy link
Collaborator

send should be top level option, not nested in an object, see https://github.com/forwardemail/email-templates#basic

@martinpiria
Copy link
Author

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

@niftylettuce
Copy link
Collaborator

you have to configure a transport, see nodemailer docs

@ohabash
Copy link

ohabash commented Mar 29, 2022

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,
    });

@ohabash
Copy link

ohabash commented Mar 29, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants