Skip to content

Commit

Permalink
fix: fix mailgun
Browse files Browse the repository at this point in the history
  • Loading branch information
nichenqin committed Aug 15, 2024
1 parent e1b799e commit 8567d93
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
"got": "^14.4.2",
"handlebars": "^4.7.8",
"lucia": "^3.2.0",
"mailgun-nodemailer-transport": "^3.0.2",
"minio": "^8.0.1",
"nanoid": "^5.0.7",
"nodemailer": "^6.9.14",
"nodemailer-mailgun-transport": "^2.1.5",
"oslo": "^1.2.1",
"radash": "^12.1.0",
"reflect-metadata": "^0.2.2",
Expand All @@ -57,7 +57,6 @@
},
"devDependencies": {
"@types/nodemailer": "^6.4.15",
"@types/nodemailer-mailgun-transport": "^1.4.6",
"@types/uuid": "^10.0.0",
"bun-types": "latest",
"kysely": "^0.27.4"
Expand Down
9 changes: 4 additions & 5 deletions apps/backend/src/modules/mail/mail.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import { singleton } from "@undb/di"
import { env } from "@undb/env"
import { createLogger } from "@undb/logger"
import { IMailService, ISendInput } from "@undb/mail"
import MailgunTransport from "mailgun-nodemailer-transport"
import { createTransport } from "nodemailer"
import mg from "nodemailer-mailgun-transport"
import SMTPConnection from "nodemailer/lib/smtp-connection"
import { compile } from "./templates/compile"

function createMailerTransport() {
if (env.UNDB_MAIL_PROVIDER === "nodemailer" || !env.UNDB_MAIL_PROVIDER) {
const options: SMTPConnection.Options = {
const options = {
host: env.UNDB_MAIL_HOST,
port: 465,
// port: env.UNDB_MAIL_PORT ? parseInt(env.UNDB_MAIL_PORT, 10) : undefined,
Expand All @@ -25,9 +24,9 @@ function createMailerTransport() {
}

return createTransport(
mg({
new MailgunTransport({
auth: {
api_key: env.UNDB_MAILGUN_API_KEY!,
apiKey: env.UNDB_MAILGUN_API_KEY!,
domain: env.UNDB_MAILGUN_DOMAIN!,
},
}),
Expand Down
Binary file modified bun.lockb
Binary file not shown.

0 comments on commit 8567d93

Please sign in to comment.