-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix back on mailjet because data.gouv.fr is blocked
- Loading branch information
Showing
5 changed files
with
31 additions
and
18 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 |
---|---|---|
|
@@ -21,9 +21,9 @@ | |
|
||
"NODE_TLS_REJECT_UNAUTHORIZED": 0, | ||
|
||
"SMTP_USER": "[email protected]", | ||
"SMTP_PASS": "pass", | ||
"SMTP_HOST": "yourdomain.com" | ||
"MAILJET_SENDER": "[email protected]", | ||
"MAILJET_API_KEY": "mailjet_api_key", | ||
"MAILJET_SECRET_KEY": "mailjet_secret_key" | ||
} | ||
} | ||
] | ||
|
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 |
---|---|---|
|
@@ -63,7 +63,7 @@ function sendConfirmationToUser(email, demande, college, req) { | |
body += 'Vous recevrez une réponse avant le 15 octobre au plus tard.<br>'; | ||
body += 'Merci d’avoir utilisé ce service et en cas de question n\'hésitez pas à nous écrire à "' + college.contact + '" ou à contacter l\'intendance au ' + college.telephone + '.<body><html>'; | ||
|
||
sendMail(email, config.user, subject, body); | ||
sendMail(email, '[email protected]', subject, body); | ||
req.log.info('Notification sent to: ' + email); | ||
} | ||
|
||
|
@@ -84,7 +84,7 @@ function sendNotificationToAgent(identite, college, req) { | |
'<h3><a href="' + dashboard + '">Cliquez ici pour voir la liste des demandes passées</a></h3>\n' + | ||
'Si le lien ne marche pas, vous pouvez copier/coller cette adresse dans votre navigateur:\n' + dashboard; | ||
|
||
sendMail(email, config.user, subject, body); | ||
sendMail(email, '[email protected]', subject, body); | ||
req.log.info('Notification sent to: ' + etablissement.contact); | ||
} | ||
}); | ||
|
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 |
---|---|---|
|
@@ -3,25 +3,17 @@ | |
var nodemailer = require('nodemailer'); | ||
var smtpTransport = require('nodemailer-smtp-transport'); | ||
|
||
var config = require('../../config/environment').smtp; | ||
var config = require('../../config/environment').mailjet; | ||
|
||
exports.sendMail = function(to, from, subject, body, attachments, done) { | ||
exports.sendMail = function(to, replyTo, subject, body, attachments, done) { | ||
var transporter = nodemailer.createTransport( | ||
smtpTransport({ | ||
port: 587, | ||
host: config.host, | ||
secure: false, | ||
requireTLS: true, | ||
auth: { | ||
user: config.user, | ||
pass: config.pass | ||
} | ||
}) | ||
smtpTransport(config) | ||
); | ||
|
||
var mailOptions = { | ||
from: from, | ||
from: '[email protected]', | ||
to: to, | ||
replyTo: replyTo, | ||
subject: 'Bourse - ' + subject, | ||
html: body | ||
}; | ||
|
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