Skip to content

Commit befad7d

Browse files
megothkjetilk
authored andcommitted
Adding delete-account.js (for email sending when deleting account)
1 parent 7f412ce commit befad7d

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
'use strict'
2+
3+
/**
4+
* Returns a partial Email object (minus the `to` and `from` properties),
5+
* suitable for sending with Nodemailer.
6+
*
7+
* Used to send a Delete Account email, upon user request
8+
*
9+
* @param data {Object}
10+
*
11+
* @param data.deleteUrl {string}
12+
* @param data.webId {string}
13+
*
14+
* @return {Object}
15+
*/
16+
function render (data) {
17+
return {
18+
subject: 'Delete Solid-account request',
19+
20+
/**
21+
* Text version
22+
*/
23+
text: `Hi,
24+
25+
We received a request to delete your Solid account, ${data.webId}
26+
27+
To delete your account, click on the following link:
28+
29+
${data.deleteUrl}
30+
31+
If you did not mean to delete your account, ignore this email.`,
32+
33+
/**
34+
* HTML version
35+
*/
36+
html: `<p>Hi,</p>
37+
38+
<p>We received a request to delete your Solid account, ${data.webId}</p>
39+
40+
<p>To delete your account, click on the following link:</p>
41+
42+
<p><a href="${data.deleteUrl}">${data.deleteUrl}</a></p>
43+
44+
<p>If you did not mean to delete your account, ignore this email.</p>
45+
`
46+
}
47+
}
48+
49+
module.exports.render = render

0 commit comments

Comments
 (0)