listmonk icon indicating copy to clipboard operation
listmonk copied to clipboard

Allow for redirect after a user confirmed their subscription

Open naxey opened this issue 11 months ago • 1 comments

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.

naxey avatar Apr 30 '25 13:04 naxey

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";
        }
    }
})();

knadh avatar Apr 30 '25 17:04 knadh