adonisjs / mail

AdonisJS Email Provider
MIT License
104 stars 34 forks source link

Migrate AWS SDK to V3 #90

Closed akatora28 closed 9 months ago

akatora28 commented 1 year ago

Using the SES driver still works for sending emails, but I'm getting an unhandled exception and a console warning to upgrade to the V3 javascript aws-sdk. Issue #84 already mentioned this, but the issue is now reported as abandoned.

Virk, are there any updates in Adonisjs v6 to the mailer that make this an unneeded update? If not I can work on migrating the AWS version here.

(node:95285) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
[1697747939854] FATAL (<PROJECT>/95285 on iMac-Pro-2.local): "uncaughtException" detected
    TypeError: ctx.response.safeStatus is not a function...

Package version

^8.2.1

Node.js and npm version

Node 16.16.0 NPM: 8.19.2

Sample Code (to reproduce the issue)

    if(user) {
      await Mail.send(message => {
        message
          .from('no-reply@example.com')
          .to(user.email)
          .subject('Reset Your Password')
          .html(`Reset your password by <a href="${Env.get("APP_URL")}${resetLink}">clicking here</a>`)
      })
    }
thetutlage commented 9 months ago

It has been upgraded for the next major release. https://github.com/adonisjs/mail/blob/develop/package.json#L98