Skip to content

Commit

Permalink
fix(email-service): Update nodemailer package and update SES transpor…
Browse files Browse the repository at this point in the history
…t to match aws v3 (#15689)

Update how aws ses client package is imported and the nodemailer SES transport is constructed to use aws v3 api.

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
saevarma and kodiakhq[bot] authored Aug 16, 2024
1 parent bb33414 commit 469ddd5
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 18 deletions.
7 changes: 4 additions & 3 deletions libs/email-service/src/lib/email.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import nodemailer from 'nodemailer'
import { SESClient, SESClientConfig } from '@aws-sdk/client-ses'
import * as aws from '@aws-sdk/client-ses'

import { Inject } from '@nestjs/common'

Expand Down Expand Up @@ -52,16 +52,17 @@ export class EmailService {

this.logger.debug('Using SES')

const cfg: SESClientConfig = {
const cfg: aws.SESClientConfig = {
apiVersion: '2010-12-01',
}

if (this.config.region) {
cfg.region = this.config.region
}

const ses = new aws.SES(cfg)
return {
SES: new SESClient(cfg),
SES: { ses, aws },
}
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"@storybook/core-server": "7.6.9",
"@types/archiver": "6.0.2",
"@types/faker": "5.5.3",
"@types/nodemailer": "6.4.1",
"@types/nodemailer": "6.4.15",
"@types/pdfkit": "0.11.2",
"@types/pubsub-js": "1.8.1",
"@types/react-csv": "1.1.1",
Expand Down Expand Up @@ -240,7 +240,7 @@
"node-fetch": "2.6.7",
"node-gyp": "9.1.0",
"node-html-markdown": "1.3.0",
"nodemailer": "6.7.2",
"nodemailer": "6.9.14",
"oidc-client-ts": "2.4.0",
"openapi3-ts": "2.0.0",
"opossum": "6.1.0",
Expand Down
33 changes: 20 additions & 13 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22024,12 +22024,12 @@ __metadata:
languageName: node
linkType: hard

"@types/nodemailer@npm:6.4.1":
version: 6.4.1
resolution: "@types/nodemailer@npm:6.4.1"
"@types/nodemailer@npm:6.4.15":
version: 6.4.15
resolution: "@types/nodemailer@npm:6.4.15"
dependencies:
"@types/node": "*"
checksum: 58239d1996c0f7f5f7a9373e575e1889c7757af30064803efc2032f87d4be7a62cb87df401b8ed060f919af9606bbb7470450a44b46a53ff12041e7fac8acb8a
checksum: f6f9a2f8a669703ecc3ca6359c12345b16f6b2e5691b93c406b9af7de639c02092ec00133526e6fecd8c60d884890a7cd0f967d8e64bedab46d5c3d8be0882d7
languageName: node
linkType: hard

Expand Down Expand Up @@ -38559,7 +38559,7 @@ __metadata:
"@types/mailparser": 3.4.0
"@types/memoizee": 0.4.5
"@types/node": 18.16.9
"@types/nodemailer": 6.4.1
"@types/nodemailer": 6.4.15
"@types/opossum": 4.1.1
"@types/passport-jwt": 3.0.8
"@types/pdfkit": 0.11.2
Expand Down Expand Up @@ -38724,7 +38724,7 @@ __metadata:
node-fetch: 2.6.7
node-gyp: 9.1.0
node-html-markdown: 1.3.0
nodemailer: 6.7.2
nodemailer: 6.9.14
nx: 19.4.0
oidc-client-ts: 2.4.0
openapi3-ts: 2.0.0
Expand Down Expand Up @@ -44679,20 +44679,27 @@ __metadata:
languageName: node
linkType: hard

"nodemailer@npm:6.7.2, nodemailer@npm:^6.4.16":
version: 6.7.2
resolution: "nodemailer@npm:6.7.2"
checksum: 3c37a40928448e2f5118a9f2f016c7a4f32228d0e6b7cc7d1834b8001374cc77280dc077a83239420f6daea4c898d9a1f336dfc2273bb7eddaf51a36bd126f72
languageName: node
linkType: hard

"nodemailer@npm:6.7.3":
version: 6.7.3
resolution: "nodemailer@npm:6.7.3"
checksum: b94d099f00f25666fc96a7cb498045e7428045b8cc0245ce10522190fd513b586d6e31305afd019f6878f1540d14d169d0dbe2e1f77385795c7054912d822ec0
languageName: node
linkType: hard

"nodemailer@npm:6.9.14":
version: 6.9.14
resolution: "nodemailer@npm:6.9.14"
checksum: 4037a45e24dbca47c0ea9a962d2c316deef7afe6ebf73c7da3a84942a8d501d85aae7f36dc1c5dac58dec7275f7cb1c92fd4f9c7c19f037225019ad2f402a9dc
languageName: node
linkType: hard

"nodemailer@npm:^6.4.16":
version: 6.7.2
resolution: "nodemailer@npm:6.7.2"
checksum: 3c37a40928448e2f5118a9f2f016c7a4f32228d0e6b7cc7d1834b8001374cc77280dc077a83239420f6daea4c898d9a1f336dfc2273bb7eddaf51a36bd126f72
languageName: node
linkType: hard

"nopt@npm:^4.0.1":
version: 4.0.3
resolution: "nopt@npm:4.0.3"
Expand Down

0 comments on commit 469ddd5

Please sign in to comment.