nest-modules/mailer

Mail not sent on Production without error / info

sluxzer opened this issue · 0 comments

Describe the bug

We have this simple script to send an email notification

 async sendUserQuestion(parameter: createUserQuestionDto) {
    const result =  this.mailerService.sendMail({
      to: process.env.ACCOUNT_EMAIL,
      from: parameter.emailFrom,
      subject: `[Contact Us] Question From ${parameter.name} (${parameter.emailFrom})`,
      template: 'question.template.pug',
      context: {
        name: parameter.name,
        question: parameter.question,
      },
    })
    .then(() => {
        console.log('Success');
    })
    .catch(() => {
        console.log('gagal');
    });

    return result;
  }

It works locally, but when in production it's stopped on the "connection established", without further output error/anything, even the promise and catch not called.

here is the output:
image

To Reproduce
Steps to reproduce the behavior:

  1. Run the code

Expected behavior
the email is sent, or showing output promise or catch, here is the output from local

image-20231005-180309

Desktop (please complete the following information):

  • OS: Ubuntu
  • Browser: -
  • Version: 22