1
0
Fork 0

fix: Handle newsletter unsubscribe

There were a few issues with the newsletter unsubscribe links that we
sent out in the newsletter. They were pointing to the backend for one
thing.

Also updated the frontend pages to handle unsubscribe from both users
and subscribers.
This commit is contained in:
joostdecock 2024-01-02 16:59:14 +01:00
parent f8feb5cf8b
commit 9208fb9a3c
10 changed files with 71 additions and 36 deletions

View file

@ -115,7 +115,9 @@ const send = async (test = true) => {
if (l > 0) {
const body = mustache.render(template, {
...i18n[lang],
unsubscribe: `${backend}newsletter/unsubscribe/${sub.ehash}`,
unsubscribe: `https://freesewing.org${
lang === 'en' ? '/' : '/' + lang + '/'
}newsletter/unsubscribe?x=${sub.ehash}`,
content,
})
console.log(`[${lang}] ${l}/${subs} (${i}) Sending to ${sub.email}`)