make pledge-related notifications more specific and helpful (#9040)
* make pledge-related notifications more specific and helpful * further improve commit flash messages * fix minor whitespace issue
This commit is contained in:
@ -104,7 +104,9 @@ export default function commit(app) {
|
|||||||
req.flash('info', {
|
req.flash('info', {
|
||||||
msg: dedent`
|
msg: dedent`
|
||||||
Looks like you already have a pledge to ${pledge.displayName}.
|
Looks like you already have a pledge to ${pledge.displayName}.
|
||||||
Hitting commit here will replace your old commitment.
|
Clicking "Commit" here will replace your old commitment. If you
|
||||||
|
do change your commitment, please remember to cancel your
|
||||||
|
previous recurring donation directly with ${pledge.displayName}.
|
||||||
`
|
`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -169,7 +171,8 @@ export default function commit(app) {
|
|||||||
msg: dedent`
|
msg: dedent`
|
||||||
Congratulations, you have committed to giving
|
Congratulations, you have committed to giving
|
||||||
${displayName} $${amount} each month until you have completed
|
${displayName} $${amount} each month until you have completed
|
||||||
your ${goal}.
|
your ${goal}. Please remember to cancel your pledge directly
|
||||||
|
with ${displayName} once you finish.
|
||||||
`
|
`
|
||||||
});
|
});
|
||||||
res.redirect('/' + user.username);
|
res.redirect('/' + user.username);
|
||||||
@ -217,11 +220,18 @@ export default function commit(app) {
|
|||||||
})
|
})
|
||||||
.subscribe(
|
.subscribe(
|
||||||
pledge => {
|
pledge => {
|
||||||
let msg = 'You have successfully stopped your pledge.';
|
let msg = dedent`
|
||||||
|
You have successfully stopped your pledge. Please
|
||||||
|
rememberto cancel your recurring donation directly
|
||||||
|
with the nonprofit if you haven't already done so.
|
||||||
|
`;
|
||||||
if (!pledge) {
|
if (!pledge) {
|
||||||
msg = `No pledge found for user ${user.username}.`;
|
msg = dedent`
|
||||||
|
It doesn't look like you had an active pledge, so
|
||||||
|
there's no pledge to stop.
|
||||||
|
`;
|
||||||
}
|
}
|
||||||
req.flash('errors', { msg });
|
req.flash('info', { msg });
|
||||||
return res.redirect(`/${user.username}`);
|
return res.redirect(`/${user.username}`);
|
||||||
},
|
},
|
||||||
next
|
next
|
||||||
|
Reference in New Issue
Block a user