mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Updated members api to use type
for url/email
no-issue This adds basic templates for "signup"/"signin"/"subscribe" types for the magic-link email template. It also adds the action query parameter to the link so that clientside js can handle the different states.
This commit is contained in:
parent
3507df8a7c
commit
a0a406fe6a
1 changed files with 24 additions and 1 deletions
|
@ -122,9 +122,10 @@ function createApiInstance() {
|
|||
privateKey: settingsCache.get('members_private_key')
|
||||
},
|
||||
auth: {
|
||||
getSigninURL(token) {
|
||||
getSigninURL(token, type) {
|
||||
const signinURL = new URL(siteUrl);
|
||||
signinURL.searchParams.set('token', token);
|
||||
signinURL.searchParams.set('action', type);
|
||||
return signinURL.href;
|
||||
}
|
||||
},
|
||||
|
@ -136,6 +137,28 @@ function createApiInstance() {
|
|||
}
|
||||
return ghostMailer.send(Object.assign({subject: 'Signin'}, message));
|
||||
}
|
||||
},
|
||||
getText(url, type) {
|
||||
switch (type) {
|
||||
case 'subscribe':
|
||||
return `Click here to confirm your subscription ${url}`;
|
||||
case 'signup':
|
||||
return `Click here to confirm your email address and sign up ${url}`;
|
||||
case 'signin':
|
||||
default:
|
||||
return `Click here to sign in ${url}`;
|
||||
}
|
||||
},
|
||||
getHTML(url, type) {
|
||||
switch (type) {
|
||||
case 'subscribe':
|
||||
return `<a href="${url}">Click here to confirm your subscription</a>`;
|
||||
case 'signup':
|
||||
return `<a href="${url}">Click here to confirm your email address and sign up</a>`;
|
||||
case 'signin':
|
||||
default:
|
||||
return `<a href="${url}">Click here to sign in</a>`;
|
||||
}
|
||||
}
|
||||
},
|
||||
paymentConfig: {
|
||||
|
|
Loading…
Add table
Reference in a new issue