-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configuration for email service (#5)
- Loading branch information
Showing
5 changed files
with
46 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,20 @@ BASE_URL=http://localhost:3005 | |
MAILER_IDENTITY_EMAIL=bot@example | ||
MAILER_IDENTITY_PASSWORD=password | ||
MAILER_IDENTITY_PROVIDER=http://localhost:3456 | ||
|
||
# SMTP Transport for sending emails | ||
# string or undefined | ||
SMTP_TRANSPORT_HOST= | ||
# number | ||
SMTP_TRANSPORT_PORT=1025 | ||
# boolean - give truthy value if true, otherwise leave empty | ||
SMTP_TRANSPORT_SECURE= | ||
# string or undefined | ||
SMTP_TRANSPORT_AUTH_USER= | ||
# string or undefined | ||
SMTP_TRANSPORT_AUTH_PASS= | ||
# boolean | ||
SMTP_TRANSPORT_REQUIRE_TLS= | ||
|
||
# email address which will be the sender of the notifications and email verification messages | ||
EMAIL_SENDER=[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import * as nodemailer from 'nodemailer' | ||
import Mail from 'nodemailer/lib/mailer' | ||
import { smtpTransportOptions } from '../config' | ||
|
||
export const sendMail = async (options: Mail.Options) => { | ||
const smtpTransport = nodemailer.createTransport({ port: 1025 }) | ||
const smtpTransport = nodemailer.createTransport(smtpTransportOptions) | ||
await smtpTransport.sendMail(options) | ||
} |