Skip to content

Commit

Permalink
feat: use gmail service instead of smtp
Browse files Browse the repository at this point in the history
  • Loading branch information
nhsz committed Apr 14, 2020
1 parent 1f3db61 commit e6ec8e7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions api/mail.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
const nodemailer = require('nodemailer');
const paymentBodyTemplate = require('./utils/bodyTemplate');

const { SMTP_HOST, SMTP_PORT, EMAIL_USER, EMAIL_PASS } = process.env;
const { EMAIL_USER, CLIENT_ID, CLIENT_SECRET, REFRESH_TOKEN } = process.env;

const transport = nodemailer.createTransport({
host: SMTP_HOST,
port: SMTP_PORT,
secure: true,
service: 'gmail',
auth: {
type: 'OAuth2',
user: EMAIL_USER,
pass: EMAIL_PASS
clientId: CLIENT_ID,
clientSecret: CLIENT_SECRET,
refreshToken: REFRESH_TOKEN
}
});

Expand Down

0 comments on commit e6ec8e7

Please sign in to comment.