@@ -170,7 +170,12 @@ app.post("/register", async (req, res) => {
170
170
if ( tokenRows . length > 0 ) {
171
171
const token = tokenRows [ 0 ] . token ;
172
172
try {
173
- await sendConfirmationEmail ( userEmail , req . headers . host , token ) ;
173
+ await sendConfirmationEmail (
174
+ userEmail ,
175
+ username ,
176
+ req . headers . host ,
177
+ token
178
+ ) ;
174
179
res . send (
175
180
"Account already exists but is not active. Confirmation email has been resent. Check your inbox and spam folder."
176
181
) ;
@@ -197,7 +202,7 @@ app.post("/register", async (req, res) => {
197
202
}
198
203
199
204
try {
200
- await sendConfirmationEmail ( userEmail , req . headers . host , token ) ;
205
+ await sendConfirmationEmail ( userEmail , username , req . headers . host , token ) ;
201
206
} catch ( err ) {
202
207
console . error ( err ) ;
203
208
res
@@ -225,15 +230,15 @@ app.post("/register", async (req, res) => {
225
230
res . send ( "Check your email for a confirmation link" ) ;
226
231
} ) ;
227
232
228
- function sendConfirmationEmail ( userEmail , host , token ) {
233
+ function sendConfirmationEmail ( userEmail , username , host , token ) {
229
234
const mailOptions = {
230
235
from : `"${ process . env . MAIL_NAME } " <${ process . env . MAIL_FROM } >` ,
231
236
to : userEmail ,
232
237
subject : "Registration Confirmation for mc.chs.se" ,
233
- text : `Hello,
238
+ text : `Hello ${ username } ,
234
239
Please confirm your registration by clicking the following link: http://${ host } /confirm/${ token }
235
240
236
- If you did not request this, please ignore this email.` ,
241
+ This email was sent from mc.chs.se. If you did not request this, please ignore this email. Contact support@chs.se for assistance .`,
237
242
} ;
238
243
239
244
return new Promise ( ( resolve , reject ) => {
0 commit comments