forked from parse-community/parse-server
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMailAdapter.js
More file actions
38 lines (30 loc) · 974 Bytes
/
MailAdapter.js
File metadata and controls
38 lines (30 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var defaultResetEmail =
"Hi,\n\n" +
"You requested a password reset.\n\n" +
"" +
"Click here to reset it:\n" +
"<%LINK_GOES_HERE%>";
var defaultVerify =
"Hi,\n\n" +
"You are being asked to confirm the e-mail address <%EMAIL_GOES_HERE%>\n\n" +
"" +
"Click here to confirm it:\n" +
"<%LINK_GOES_HERE%>";
function MailAdapter() {
}
MailAdapter.prototype.sendMail = function(to, subject, text) {
throw new Error("Send mail must be overridden")
};
MailAdapter.prototype.getResetPasswordEmail = function(to, resetLink) {
return {
subject: 'Password Reset Request',
text: defaultResetEmail.replace("<%LINK_GOES_HERE%>", resetLink)
}
};
MailAdapter.prototype.getVerificationEmail = function(to, verifyLink) {
return {
subject: 'Please verify your e-mail',
text: defaultVerify.replace("<%EMAIL_GOES_HERE%>", to).replace("<%LINK_GOES_HERE%>", verifyLink)
}
};
module.exports = MailAdapter;