orliesaurus / nodemailer-mailgun-transport

nodemailer is an amazing node module to send emails within any of your nodejs apps. This is the transport plugin that goes with nodemailer to send email using Mailgun 🔫
MIT License
880 stars 97 forks source link

Error: apiKey value must be defined! #100

Closed WillSquire closed 3 years ago

WillSquire commented 3 years ago

This isn't working at all for me. When apiKey is set it still throws Error: apiKey value must be defined! from the mailgun-js dependency.

MailGunTransport({
  auth: {
    apiKey: configService.emailApiKey, // tried hard coding this, the value is definitely set
    domain: configService.emailDomain,
  },
  host: 'api.eu.mailgun.net',
}),

Versions: "nodemailer": "^6.4.16", "nodemailer-mailgun-transport": "^2.0.1",

orliesaurus commented 3 years ago

looks like you have a spelling error on the key name. Compare to this:

  auth: {
    api_key: 'key-1234123412341234',
    domain: 'one of your domain names listed at your https://mailgun.com/app/domains'
  },
  host: 'api.eu.mailgun.net'
}
orliesaurus commented 3 years ago

@WillSquire can you let me know?

zgid123 commented 3 years ago

@WillSquire if you use with typescript, ignore the apiKey right now. Because my PR is merged but still not released yet

WillSquire commented 3 years ago

Apologies for not getting back. It is indeed the Typescript definition

zgid123 commented 3 years ago

yup, I created that option after this PR #98 was merged, but the @types already released but the version of this package did not

orliesaurus commented 3 years ago

yup, I created that option after this PR #98 was merged, but the @types already released but the version of this package did not

Did I forget to npm publish your version?

zgid123 commented 3 years ago

Yes. I just reinstalled this package again and no new version. Checked the code in node_modules, the code does not contain my change

orliesaurus commented 3 years ago

Yes. I just reinstalled this package again and no new version. Checked the code in node_modules, the code does not contain my change

Alright gonna fix it today! Thank you for reminding me I must ve forgotten woops!

orliesaurus commented 3 years ago

abrakadabra - pushed! Thanks @zgid123

zgid123 commented 3 years ago

thank you, just tested and it worked with apiKey

orliesaurus commented 3 years ago

Perfect closing