Skip to content

Commit 8567d93

Browse files
committed
fix: fix mailgun
1 parent e1b799e commit 8567d93

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

apps/backend/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@
4545
"got": "^14.4.2",
4646
"handlebars": "^4.7.8",
4747
"lucia": "^3.2.0",
48+
"mailgun-nodemailer-transport": "^3.0.2",
4849
"minio": "^8.0.1",
4950
"nanoid": "^5.0.7",
5051
"nodemailer": "^6.9.14",
51-
"nodemailer-mailgun-transport": "^2.1.5",
5252
"oslo": "^1.2.1",
5353
"radash": "^12.1.0",
5454
"reflect-metadata": "^0.2.2",
@@ -57,7 +57,6 @@
5757
},
5858
"devDependencies": {
5959
"@types/nodemailer": "^6.4.15",
60-
"@types/nodemailer-mailgun-transport": "^1.4.6",
6160
"@types/uuid": "^10.0.0",
6261
"bun-types": "latest",
6362
"kysely": "^0.27.4"

apps/backend/src/modules/mail/mail.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@ import { singleton } from "@undb/di"
22
import { env } from "@undb/env"
33
import { createLogger } from "@undb/logger"
44
import { IMailService, ISendInput } from "@undb/mail"
5+
import MailgunTransport from "mailgun-nodemailer-transport"
56
import { createTransport } from "nodemailer"
6-
import mg from "nodemailer-mailgun-transport"
7-
import SMTPConnection from "nodemailer/lib/smtp-connection"
87
import { compile } from "./templates/compile"
98

109
function createMailerTransport() {
1110
if (env.UNDB_MAIL_PROVIDER === "nodemailer" || !env.UNDB_MAIL_PROVIDER) {
12-
const options: SMTPConnection.Options = {
11+
const options = {
1312
host: env.UNDB_MAIL_HOST,
1413
port: 465,
1514
// port: env.UNDB_MAIL_PORT ? parseInt(env.UNDB_MAIL_PORT, 10) : undefined,
@@ -25,9 +24,9 @@ function createMailerTransport() {
2524
}
2625

2726
return createTransport(
28-
mg({
27+
new MailgunTransport({
2928
auth: {
30-
api_key: env.UNDB_MAILGUN_API_KEY!,
29+
apiKey: env.UNDB_MAILGUN_API_KEY!,
3130
domain: env.UNDB_MAILGUN_DOMAIN!,
3231
},
3332
}),

bun.lockb

-3.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)