Commit 694f15b2 authored by Varun Srivastava's avatar Varun Srivastava
Browse files

email signature changes

6 merge requests!143updating yml config,!64Prepare production,!63Prepare after testing,!62Testing,!59Mlab 240,!53Mlab 133
Showing with 67 additions and 35 deletions
+67 -35
...@@ -44,7 +44,8 @@ module.exports = { ...@@ -44,7 +44,8 @@ module.exports = {
saml: { saml: {
path: process.env.SAML_PATH || '/saml/SSO', path: process.env.SAML_PATH || '/saml/SSO',
entryPoint: process.env.SAML_ENTRY_POINT || 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SSOService.php', entryPoint: process.env.SAML_ENTRY_POINT || 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SSOService.php',
issuer: 'sp-account-testing.m4lab.hft-stuttgart.de', //testing metadata issuer: 'sp-account.m4lab.hft-stuttgart.de', //local metadata
//issuer: 'sp-account-testing.m4lab.hft-stuttgart.de', //testing metadata
//issuer: 'sp-account-prod.m4lab.hft-stuttgart.de', //production metadata //issuer: 'sp-account-prod.m4lab.hft-stuttgart.de', //production metadata
logoutUrl: 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php' logoutUrl: 'https://m4lab.hft-stuttgart.de/idp/saml2/idp/SingleLogoutService.php'
} }
......
...@@ -22,6 +22,20 @@ module.exports = function (app, config, passport, i18n) { ...@@ -22,6 +22,20 @@ module.exports = function (app, config, passport, i18n) {
done(null, user); done(null, user);
}); });
const mailSignature = 'Mit den besten Grüßen,<br/>das Transferportal-Team der HFT Stuttgart<br/><br/>' +
'Transferportal der Hochschule für Technik Stuttgart<br/>' +
'Schellingstr. 24 70174 Stuttgart<br/>' +
'm4lab@hft-stuttgart.de<br/>' +
'https://transfer.hft-stuttgart.de<br/>' +
'<a href="http://www.hft-stuttgart.de/Aktuell/"><img border="0" alt="HFT" src="HFT_logo.png"></a> &nbsp;' +
'<a href="http://www.facebook.com/hftstuttgart"><img border="0" alt="Facebook" src="facebook.png"></a> &nbsp;' +
'<a href="https://www.instagram.com/hft_stuttgart/"><img border="0" alt="Instagram" src="instagram.png"></a> &nbsp;' +
'<a href="https://twitter.com/hft_presse"><img border="0" alt="Twitter" src="twitter.png"></a> &nbsp;' +
'<a href="https://www.youtube.com/channel/UCi0_JfF2qMZbOhOnNH5PyHA"><img border="0" alt="Youtube" src="youtube.png"></a> &nbsp;' +
'<a href="http://www.hft-stuttgart.de/Aktuell/Presse-Marketing/SocialMedia/Snapcode HFT_Stuttgart.jpg/photo_view">' +
'<img border="0" alt="Snapchat" src="snapchat.png"></a>' +
'<br/><img border="0" src="Innovative_Hochschule.png">'
var samlStrategy = new SamlStrategy({ var samlStrategy = new SamlStrategy({
// URL that goes from the Identity Provider -> Service Provider // URL that goes from the Identity Provider -> Service Provider
callbackUrl: config.passport.saml.path, callbackUrl: config.passport.saml.path,
...@@ -86,13 +100,13 @@ module.exports = function (app, config, passport, i18n) { ...@@ -86,13 +100,13 @@ module.exports = function (app, config, passport, i18n) {
// ======== APP ROUTES - ACCOUNT ==================== // ======== APP ROUTES - ACCOUNT ====================
var updatePasswordMailSubject = "Ihr Passwort für das Transferportal wurde gespeichert." var updatePasswordMailSubject = "Ihr Passwort für das Transferportal wurde gespeichert."
var mailSignature = "Mit den besten Grüßen,\ndas Transferportal-Team der HFT Stuttgart\n\n"+ // var mailSignature = "Mit den besten Grüßen,\ndas Transferportal-Team der HFT Stuttgart\n\n"+
"Transferportal der Hochschule für Technik Stuttgart\n"+ // "Transferportal der Hochschule für Technik Stuttgart\n"+
"Schellingstr. 24\n"+ // "Schellingstr. 24\n"+
"70174 Stuttgart\n"+ // "70174 Stuttgart\n"+
"m4lab@hft-stuttgart.de\n"+ // "m4lab@hft-stuttgart.de\n"+
"https://transfer.hft-stuttgart.de" // "https://transfer.hft-stuttgart.de"
var updatePasswordMailContent = "Lieber Nutzer,\n\n"+"Ihr Passwort wurde erfolgreich geändert.\n\n"+mailSignature var updatePasswordMailContent = '<div>Lieber Nutzer,<br/><br/>Ihr Passwort wurde erfolgreich geändert.<br/><br/>' + mailSignature + '</div>';
app.get('/', function (req, res) { app.get('/', function (req, res) {
if (req.isAuthenticated()) { if (req.isAuthenticated()) {
...@@ -346,7 +360,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -346,7 +360,7 @@ module.exports = function (app, config, passport, i18n) {
mailer.options.to = req.user.email mailer.options.to = req.user.email
//mailOptions.subject = "Your M4_LAB Password has been updated." //mailOptions.subject = "Your M4_LAB Password has been updated."
mailer.options.subject = updatePasswordMailSubject mailer.options.subject = updatePasswordMailSubject
mailer.options.text = updatePasswordMailContent mailer.options.html = updatePasswordMailContent
mailer.transport.sendMail(mailer.options, function(err) { mailer.transport.sendMail(mailer.options, function(err) {
if (err) { if (err) {
console.log(err) console.log(err)
...@@ -402,12 +416,17 @@ module.exports = function (app, config, passport, i18n) { ...@@ -402,12 +416,17 @@ module.exports = function (app, config, passport, i18n) {
"Otherwise, you can reset your password using this link: http://m4lab.hft-stuttgart.de/account/reset/" + token + "\n" + "Otherwise, you can reset your password using this link: http://m4lab.hft-stuttgart.de/account/reset/" + token + "\n" +
"This password reset is only valid for 1 hour.\n\n"+ "This password reset is only valid for 1 hour.\n\n"+
"Thanks,\nM4_LAB Team" */ "Thanks,\nM4_LAB Team" */
var emailContent = "Lieber Nutzer,\n\n"+ // var emailContent = "Lieber Nutzer,\n\n"+
"wir haben Ihre Anfrage zur Erneuerung Ihres Passwortes erhalten. Falls Sie diese Anfrage nicht gesendet haben, ignorieren Sie bitte diese E-Mail.\n\n"+ // "wir haben Ihre Anfrage zur Erneuerung Ihres Passwortes erhalten. Falls Sie diese Anfrage nicht gesendet haben, ignorieren Sie bitte diese E-Mail.\n\n"+
"Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: http://m4lab.hft-stuttgart.de/account/reset/" + token + "\n" + // test server // "Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: http://m4lab.hft-stuttgart.de/account/reset/" + token + "\n" + // test server
//"Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: http://localhost:9989/reset/" + token + "\n" + // localhost // //"Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: http://localhost:9989/reset/" + token + "\n" + // localhost
"Dieser Link ist aus Sicherheitsgründen nur für 1 Stunde gültig.\n\n"+mailSignature // "Dieser Link ist aus Sicherheitsgründen nur für 1 Stunde gültig.\n\n"+mailSignature
var emailContent = '<div>Lieber Nutzer, Varun<br/><br/>' +
'<p>wir haben Ihre Anfrage zur Erneuerung Ihres Passwortes erhalten. Falls Sie diese Anfrage nicht gesendet haben, ignorieren Sie bitte diese E-Mail.<br/><br/>' +
'Sie können Ihr Passwort mit dem Klick auf diesen Link ändern: http://m4lab.hft-stuttgart.de/account/reset/' + token + '<br/>' + // test server
'Dieser Link ist aus Sicherheitsgründen nur für 1 Stunde gültig.<br/></p>' + mailSignature + '</div>';
var credentialData = { var credentialData = {
user_id: user.id, user_id: user.id,
resetPasswordToken: token, resetPasswordToken: token,
...@@ -420,7 +439,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -420,7 +439,7 @@ module.exports = function (app, config, passport, i18n) {
// send email // send email
mailer.options.to = emailAddress; mailer.options.to = emailAddress;
mailer.options.subject = emailSubject; mailer.options.subject = emailSubject;
mailer.options.text = emailContent; mailer.options.html = emailContent;
mailer.transport.sendMail(mailer.options, function(err) { mailer.transport.sendMail(mailer.options, function(err) {
done(err, 'done'); done(err, 'done');
}); });
...@@ -483,7 +502,7 @@ module.exports = function (app, config, passport, i18n) { ...@@ -483,7 +502,7 @@ module.exports = function (app, config, passport, i18n) {
// send notifiaction email // send notifiaction email
mailer.options.to = user.email mailer.options.to = user.email
mailer.options.subject = updatePasswordMailSubject mailer.options.subject = updatePasswordMailSubject
mailer.options.text = updatePasswordMailContent mailer.options.html = updatePasswordMailContent
mailer.transport.sendMail(mailer.options, function(err) { mailer.transport.sendMail(mailer.options, function(err) {
if (err) { if (err) {
console.log(err) console.log(err)
...@@ -563,15 +582,20 @@ module.exports = function (app, config, passport, i18n) { ...@@ -563,15 +582,20 @@ module.exports = function (app, config, passport, i18n) {
else { else {
// send email // send email
var emailSubject = "Bitte bestätigen Sie Ihr M4_LAB Benutzerkonto" var emailSubject = "Bitte bestätigen Sie Ihr M4_LAB Benutzerkonto"
var emailContent = "Lieber Nutzer,\n\n"+ // var emailContent = "Lieber Nutzer,\n\n"+
"vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart.\n"+ // "vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart.\n"+
"Um Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: "+config.app.host+"/verifyAccount?token="+token+"\n"+ // "Um Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: "+config.app.host+"/verifyAccount?token="+token+"\n"+
"Ohne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.\n\n"+ // "Ohne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.\n\n"+
"Sollten Sie sich selbst nicht mit Ihren Daten am Transferportal registriert haben, ignorieren Sie diese E-Mail bitte.\n\n"+mailSignature // "Sollten Sie sich selbst nicht mit Ihren Daten am Transferportal registriert haben, ignorieren Sie diese E-Mail bitte.\n\n"+mailSignature
var emailContent = '<div>Lieber Nutzer,<br/><br/>' +
'<p>vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart. <br/>' +
'Um Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: ' + config.app.host + '/verifyAccount?token=' + token +
'<br/><br/>' +
'Ohne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.</p><br/>' + mailSignature +
'</div>';
mailer.options.to = req.body.inputEmail; mailer.options.to = req.body.inputEmail;
mailer.options.subject = emailSubject; mailer.options.subject = emailSubject;
mailer.options.text = emailContent; mailer.options.html = emailContent;
mailer.transport.sendMail(mailer.options, function(err) { mailer.transport.sendMail(mailer.options, function(err) {
if (err) { if (err) {
console.log('cannot send email') console.log('cannot send email')
...@@ -615,13 +639,15 @@ module.exports = function (app, config, passport, i18n) { ...@@ -615,13 +639,15 @@ module.exports = function (app, config, passport, i18n) {
else { else {
// send email // send email
var emailSubject = "Herzlich willkommen" var emailSubject = "Herzlich willkommen"
var emailContent = "Lieber Nutzer,\n\n"+ // var emailContent = "Lieber Nutzer,\n\n"+
"herzlich willkommen beim Transferportal der HFT Stuttgart!\n"+ // "herzlich willkommen beim Transferportal der HFT Stuttgart!\n"+
"Sie können nun alle Dienste des Portals nutzen.\n\n"+mailSignature // "Sie können nun alle Dienste des Portals nutzen.\n\n"+mailSignature
var emailContent = '<div>Lieber Nutzer,<br/><br/>' +
'<p>herzlich willkommen beim Transferportal der HFT Stuttgart!<br/>' +
'Sie können nun alle Dienste des Portals nutzen.<p/><br/>' + mailSignature;
mailer.options.to = data.email; mailer.options.to = data.email;
mailer.options.subject = emailSubject; mailer.options.subject = emailSubject;
mailer.options.text = emailContent; mailer.options.html = emailContent;
mailer.transport.sendMail(mailer.options, function(err) { mailer.transport.sendMail(mailer.options, function(err) {
if (err) { if (err) {
console.log('cannot send email') console.log('cannot send email')
...@@ -656,14 +682,19 @@ module.exports = function (app, config, passport, i18n) { ...@@ -656,14 +682,19 @@ module.exports = function (app, config, passport, i18n) {
if (token) { if (token) {
// send email // send email
var emailSubject = "Bitte bestätigen Sie Ihr M4_LAB Benutzerkonto" var emailSubject = "Bitte bestätigen Sie Ihr M4_LAB Benutzerkonto"
var emailContent = "Lieber Nutzer,\n\n"+ // var emailContent = "Lieber Nutzer,\n\n"+
"vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart. "+ // "vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart. "+
"\nUm Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: "+config.app.host+"/verifyAccount?token="+token+ // "\nUm Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: "+config.app.host+"/verifyAccount?token="+token+
"\n\nOhne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.\n\n"+mailSignature // "\n\nOhne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.\n\n"+mailSignature
var emailContent = '<div>Lieber Nutzer,<br/><br/>' +
'<p>vielen Dank für Ihre Anmeldung am Transferportal der HFT Stuttgart. <br/>' +
'Um Ihre Anmeldung zu bestätigen, klicken Sie bitte diesen Link: ' + config.app.host + '/verifyAccount?token=' + token +
'<br/><br/>' +
'Ohne Bestätigung Ihres Kontos müssen wir Ihr Konto leider nach 7 Tagen löschen.</p><br/>' + mailSignature +
'</div>';
mailer.options.to = emailAddress; mailer.options.to = emailAddress;
mailer.options.subject = emailSubject; mailer.options.subject = emailSubject;
mailer.options.text = emailContent; mailer.options.html = emailContent;
mailer.transport.sendMail(mailer.options, function(err) { mailer.transport.sendMail(mailer.options, function(err) {
if (err) { if (err) {
console.log('cannot send email') console.log('cannot send email')
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment