We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 395c7e0 commit 8bc0925Copy full SHA for 8bc0925
chapter-01-the-single-responsibility-principle/refactor/ConfirmationMailFactory.js
@@ -0,0 +1,20 @@
1
+function confirmationMailFactory(templating, translator) {
2
+ function createMessageFor(user) {
3
+ const subject = translator.translate('Confirm your mail address');
4
+
5
+ const body = templating.render('confirmationMail.html.tpl', {
6
+ confirmationCode: user.getConfirmationCode(),
7
+ });
8
9
+ const message = new Message(subject, body);
10
+ message.setTo(user.getEmailAddress());
11
12
+ return message;
13
+ }
14
15
+ return {
16
+ createMessageFor,
17
+ };
18
+}
19
20
+module.exports = confirmationMailFactory;
0 commit comments