Updated unsubscribe copy

This commit is contained in:
Peter Zimon 2019-11-26 11:02:53 +01:00
parent 7209abb729
commit 4790e64256
2 changed files with 4 additions and 4 deletions

View File

@ -38,7 +38,7 @@
<section class="gh-flow-content gh-flow-content-unsubscribe">
<p>
{{#if error}}
Uh oh! Unsubscribe failed: "{{error}}"
{{error}}
{{else}}
{{#if member}}<span class="gh-flow-em">{{member.email}}</span> has been successfully unsubscribed{{/if}}
{{/if}}

View File

@ -151,14 +151,14 @@ function createUnsubscribeUrl(member) {
async function handleUnsubscribeRequest(req) {
if (!req.url) {
throw new common.errors.BadRequestError({
message: 'Expected unsubscribe param containing token'
message: 'Unsubscribe failed! Could not find member'
});
}
const {query} = url.parse(req.url, true);
if (!query || !query.uuid) {
throw new common.errors.BadRequestError({
message: 'Expected unsubscribe param containing token'
message: (query.preview ? 'Unsubscribe preview' : 'Unsubscribe failed! Could not find member')
});
}
@ -168,7 +168,7 @@ async function handleUnsubscribeRequest(req) {
if (!member) {
throw new common.errors.BadRequestError({
message: 'Expected valid subscribe param - could not find member'
message: 'Unsubscribe failed! Could not find member'
});
}