Skip to content

Commit 3dbaa95

Browse files
committed
Populate emails from .env
1 parent 2d7956f commit 3dbaa95

File tree

6 files changed

+45
-19
lines changed

6 files changed

+45
-19
lines changed

.env.config

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,14 @@ JWT_SECRET='shhhh super secret code here bro'
1414
ROOT_URL='http://localhost:3000'
1515

1616
# Credentials for the admin user created at app initialization
17-
ADMIN_EMAIL='admin@example.org'
17+
ADMIN_EMAIL='admin@example.com'
1818
ADMIN_PASS='party'
1919

2020
# Used to send verification, registration, and confirmation emails
21+
EMAIL_ADDRESS='[email protected]'
22+
HACKATHON_NAME='Hackathon'
23+
TWITTER_HANDLE='hackathon'
24+
FACEBOOK_HANDLE='hackathon'
2125
EMAIL_CONTACT='Hackathon Team <[email protected]>'
2226
EMAIL_HOST='smtp.gmail.com'
2327
EMAIL_USER='[email protected]'

app.json

+14-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,22 @@
1616
},
1717
"ADMIN_EMAIL": {
1818
"description": "Credentials for the admin user created at app initialization",
19-
"value": "admin@example.org"
19+
"value": "admin@example.com"
2020
},
2121
"ADMIN_PASS": "party",
22+
"EMAIL_ADDRESS": {
23+
"description": "The email address that is included in the 'email us' link at the bottom of emails.",
24+
"value": "[email protected]"
25+
},
26+
"HACKATHON_NAME": "Hackathon",
27+
"TWITTER_HANDLE": {
28+
"description": "Everything after https://twitter.com/",
29+
"value": "hackathon"
30+
},
31+
"FACEBOOK_HANDLE": {
32+
"description": "Everything after https://facebook.com/",
33+
"value": "hackathon"
34+
},
2235
"EMAIL_CONTACT": {
2336
"description": "Used to send verification, registration, and confirmation emails",
2437
"value": "Hackathon Team <[email protected]>"

app/server/services/email.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ var emailTemplates = require('email-templates');
77

88
var ROOT_URL = process.env.ROOT_URL;
99

10+
var HACKATHON_NAME = process.env.HACKATHON_NAME;
11+
var EMAIL_ADDRESS = process.env.EMAIL_ADDRESS;
12+
var TWITTER_HANDLE = proccess.env.TWITTER_HANDLE;
13+
var FACEBOOK_HANDLE = proccess.env.FACEBOOK_HANDLE;
14+
1015
var EMAIL_HOST = process.env.EMAIL_HOST;
1116
var EMAIL_USER = process.env.EMAIL_USER;
1217
var EMAIL_PASS = process.env.EMAIL_PASS;
@@ -48,6 +53,10 @@ function sendOne(templateName, options, data, callback){
4853
}
4954

5055
data.emailHeaderImage = EMAIL_HEADER_IMAGE;
56+
data.emailAddress = EMAIL_ADDRESS;
57+
data.hackathonName = HACKATHON_NAME;
58+
data.twitterHandle = TWITTER_HANDLE;
59+
data.facebookHandle = FACEBOOK_HANDLE;
5160
template(templateName, data, function(err, html, text){
5261
if (err) {
5362
return callback(err);
@@ -79,7 +88,7 @@ controller.sendVerificationEmail = function(email, token, callback) {
7988

8089
var options = {
8190
to: email,
82-
subject: "[HACKMIT] - Verify your email"
91+
subject: "[HACKATHON] - Verify your email"
8392
};
8493

8594
var locals = {
@@ -116,7 +125,7 @@ controller.sendPasswordResetEmail = function(email, token, callback) {
116125

117126
var options = {
118127
to: email,
119-
subject: "[HACKMIT] - Password reset requested!"
128+
subject: "[HACKATHON] - Password reset requested!"
120129
};
121130

122131
var locals = {
@@ -157,7 +166,7 @@ controller.sendPasswordChangedEmail = function(email, callback){
157166

158167
var options = {
159168
to: email,
160-
subject: "[HACKMIT] - Your password has been changed!"
169+
subject: "[HACKATHON] - Your password has been changed!"
161170
};
162171

163172
var locals = {
@@ -185,4 +194,4 @@ controller.sendPasswordChangedEmail = function(email, callback){
185194

186195
};
187196

188-
module.exports = controller;
197+
module.exports = controller;

app/server/templates/email-basic/html.hbs

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<td valign="top" style="text-align: center" class="bodyContent" mc:edit="body_content00">
4040
Thanks,
4141
<br />
42-
The HackMIT Team
42+
The {{ hackathonName }} Team
4343
</td>
4444
</tr>
4545

@@ -54,13 +54,13 @@
5454
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="templateFooter">
5555
<tr>
5656
<td valign="top" class="footerContent" mc:edit="footer_content00">
57-
<a href="https://twitter.com/hackmit">Follow on Twitter</a>&nbsp;&nbsp;&nbsp;<a href="https://facebook.com/HackMIT">Like on Facebook</a>&nbsp;&nbsp;&nbsp;
58-
<a href="mailto:[email protected]">Email Us</a>
57+
<a href="https://twitter.com/{{ twitterHandle }}">Follow on Twitter</a>&nbsp;&nbsp;&nbsp;<a href="https://facebook.com/{{ facebookHandle }}">Like on Facebook</a>&nbsp;&nbsp;&nbsp;
58+
<a href="mailto:{{ emailAddress }}">Email Us</a>
5959
</td>
6060
</tr>
6161
<tr>
6262
<td valign="top" class="footerContent" style="padding-top:0;" mc:edit="footer_content01">
63-
<em>Copyright &copy; HackMIT 2015, All rights reserved.</em>
63+
<em>Copyright &copy; {{ hackathonName }} 2017, All rights reserved.</em>
6464
<br />
6565
</td>
6666
</tr>

app/server/templates/email-link-action/html.hbs

+4-4
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
<td valign="top" style="text-align: center" class="bodyContent" mc:edit="body_content00">
4646
Thanks,
4747
<br />
48-
The HackMIT Team
48+
The {{ hackathonName }} Team
4949
</td>
5050
</tr>
5151

@@ -60,13 +60,13 @@
6060
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="templateFooter">
6161
<tr>
6262
<td valign="top" class="footerContent" mc:edit="footer_content00">
63-
<a href="https://twitter.com/hackmit">Follow on Twitter</a>&nbsp;&nbsp;&nbsp;<a href="https://facebook.com/HackMIT">Like on Facebook</a>&nbsp;&nbsp;&nbsp;
64-
<a href="mailto:[email protected]">Email Us</a>
63+
<a href="https://twitter.com/{{ twitterHandle }}">Follow on Twitter</a>&nbsp;&nbsp;&nbsp;<a href="https://facebook.com/{{ facebookHandle }}">Like on Facebook</a>&nbsp;&nbsp;&nbsp;
64+
<a href="mailto:{{ emailAddress }}">Email Us</a>
6565
</td>
6666
</tr>
6767
<tr>
6868
<td valign="top" class="footerContent" style="padding-top:0;" mc:edit="footer_content01">
69-
<em>Copyright &copy; HackMIT 2015, All rights reserved.</em>
69+
<em>Copyright &copy; {{ hackathonName }} 2017, All rights reserved.</em>
7070
<br />
7171
</td>
7272
</tr>

app/server/templates/email-verify/html.hbs

+5-5
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<tr>
3232
<td valign="top" style="text-align: center" class="bodyContent" mc:edit="body_content00">
3333
<h1>Verify Your Email</h1>
34-
<h3>Thanks for signing up for HackMIT 2015!</h3>
34+
<h3>Thanks for signing up for {{ hackathonName }}!</h3>
3535
To verify your email, click the button below.
3636
<br />
3737
<br />
@@ -45,7 +45,7 @@
4545
<td valign="top" style="text-align: center" class="bodyContent" mc:edit="body_content00">
4646
Thanks,
4747
<br />
48-
The HackMIT Team
48+
The {{ hackathonName }} Team
4949
</td>
5050
</tr>
5151

@@ -60,13 +60,13 @@
6060
<table border="0" cellpadding="0" cellspacing="0" width="100%" id="templateFooter">
6161
<tr>
6262
<td valign="top" class="footerContent" mc:edit="footer_content00">
63-
<a href="https://twitter.com/hackmit">Follow on Twitter</a>&nbsp;&nbsp;&nbsp;<a href="https://facebook.com/HackMIT">Like on Facebook</a>&nbsp;&nbsp;&nbsp;
64-
<a href="mailto:[email protected]">Email Us</a>
63+
<a href="https://twitter.com/{{ twitterHandle }}">Follow on Twitter</a>&nbsp;&nbsp;&nbsp;<a href="https://facebook.com/{{ facebookHandle }}">Like on Facebook</a>&nbsp;&nbsp;&nbsp;
64+
<a href="mailto:{{ emailAddress }}">Email Us</a>
6565
</td>
6666
</tr>
6767
<tr>
6868
<td valign="top" class="footerContent" style="padding-top:0;" mc:edit="footer_content01">
69-
<em>Copyright &copy; HackMIT 2015, All rights reserved.</em>
69+
<em>Copyright &copy; {{ hackathonName }} 2017, All rights reserved.</em>
7070
<br />
7171
</td>
7272
</tr>

0 commit comments

Comments
 (0)