listmonk
listmonk copied to clipboard
Allow for redirect after a user confirmed their subscription
Is your feature request related to a problem? Please describe. No problem.
Describe the solution you'd like
When a user has signed up to a list and is on subscription/optin/ to confirm I'd love to be able to redirect them to a specific site after they confirmed.
I feel a bit ashamed even suggesting something so hacky 😄, but you can use to achieve a redirect until a future release adds support for whitelisting redirect URLs.
You can save this snippet in Admin -> Settings -> Appearance -> Public Javascript.
It looks for the /optin URL and the Confirmed header on it, then issues a redirect.
(() => {
if (document.location.href.indexOf('/subscription/optin') > -1) {
const confirmed = [...document.querySelectorAll('h2')]
.find(h2 => h2.textContent.trim().toLowerCase() === 'confirmed');
if (confirmed) {
document.location.href = "https://google.com";
}
}
})();