This repository has been archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
got mailgun to email out verfication emails, minus having the actual …
…important content alongside it
- Loading branch information
Showing
4 changed files
with
59 additions
and
4 deletions.
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
FROM node:12 | ||
|
||
LABEL maintainer="MHacks Team <[email protected]>" | ||
LABEL maintainer="MHacks Team <[email protected]>" | ||
|
||
ARG NODE_ENV | ||
ENV NODE_ENV $NODE_ENV | ||
WORKDIR /usr/src/app | ||
|
||
RUN npm install -g nodemon | ||
RUN npm install mailgun-js | ||
|
||
ADD yarn.lock . | ||
ADD package.json . | ||
|
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 |
---|---|---|
|
@@ -77,10 +77,46 @@ function sendEmailTemplate( | |
from_email, | ||
from_name | ||
) { | ||
console.log('@@@@@@@@@@@@@@@'); | ||
|
||
return new Promise((resolve, reject) => { | ||
console.log('111111111111'); | ||
|
||
var DOMAIN = 'mhacks.org'; | ||
var api_key = 'key-3c4f7813f2541f7b7ac2774aa91a6b1c'; | ||
var mailgun = require('mailgun-js')({ apiKey: api_key, domain: DOMAIN }); | ||
|
||
console.log('2222222222222'); | ||
|
||
console.log(template_content); | ||
|
||
var data = { | ||
from: from_email, | ||
to: to_email, | ||
cc: '[email protected]', | ||
subject: subject, | ||
html: template_content, | ||
}; | ||
|
||
console.log('33333333333333'); | ||
|
||
mailgun.messages().send(data, function (error, body) { | ||
console.log(body); | ||
if(error) | ||
{ | ||
reject(error); | ||
} | ||
else | ||
{ | ||
resolve(body); | ||
} | ||
}); | ||
|
||
|
||
/* | ||
mg.messages.create('mhacks.org', { | ||
from: from_email, | ||
to: [to_email], | ||
to: to_email, | ||
subject: subject, | ||
text: template_content, | ||
}) | ||
|
@@ -93,6 +129,9 @@ function sendEmailTemplate( | |
reject(err); | ||
}); // logs any error | ||
mg.messages.sendTemplate | ||
*/ | ||
|
||
/* | ||
if (!config.mandrill_token) { | ||
reject(Errors.MISSING_CONFIG); | ||
|