Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 7bc0706

Browse files
committed
Change email conf from gmail to sendgrid
1 parent eb70708 commit 7bc0706

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

config/config.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@
22
var path = require('path');
33
var CpTranslations = require('cp-translations');
44

5-
var generator = require('xoauth2').createXOAuth2Generator({
6-
user: process.env.GMAIL_USER,
7-
clientId: process.env.GMAIL_CLIENT_ID,
8-
clientSecret: process.env.GMAIL_CLIENT_SECRET,
9-
refreshToken: process.env.GMAIL_REFRESH_TOKEN
10-
});
11-
125
module.exports = function (options) {
136
function pgConfig () {
147
return {
@@ -45,15 +38,18 @@ module.exports = function (options) {
4538
}
4639
}
4740
},
48-
gmail: {
41+
email: {
4942
folder: path.resolve(CpTranslations.getEmailTemplatePath()),
5043
config: {
51-
service: 'gmail',
44+
pool: true,
45+
service: 'sendgrid',
5246
auth: {
53-
xoauth2: generator
47+
user: process.env.MAIL_USER,
48+
pass: process.env.MAIL_PASS
5449
}
5550
}
5651
},
52+
5753
'recaptcha_secret_key': process.env.RECAPTCHA_SECRET_KEY || '6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe',
5854
transport: {
5955
type: 'web',
@@ -67,7 +63,7 @@ module.exports = function (options) {
6763
coderdojoadultforums: { code: process.env.CODERDOJO_ADULT_FORUMS_SECRET || 'ilikecode',
6864
baseUrl: process.env.ADULT_FORUM + '/auth/CoderDojo/callback'},
6965
coderdojoyouthforums: { code: process.env.CODERDOJO_YOUTH_FORUMS_SECRET || 'ilikecode',
70-
baseUrl: process.env.YOUTH_FORUM + '/auth/CoderDojo/callback'}
66+
baseUrl: process.env.YOUTH_FORUM + '/auth/CoderDojo/callback'}
7167
}
7268
},
7369
nodebb: {

service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ seneca.use(store, config['postgresql-store']);
2222
if (process.env.MAILTRAP_ENABLED === 'true') {
2323
seneca.use('mail', config.mailtrap);
2424
} else {
25-
seneca.use('mail', config.gmail);
25+
seneca.use('mail', config.email);
2626
}
2727

2828
function shutdown (err) {

0 commit comments

Comments
 (0)