We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

How to use Composer to sign up users via API to a mailing list in Newsletters + Notifications when their pageview meter expires?

In order to get this to work, please create a Triggered email campaign in ESP and attach a mailing list. Then, you can use the below code in a RunJS card in your Composer experience when the pageview meter expires to sign up users to the mailing list attached to this ESP campaign. Each sign-up should trigger an email being sent to the user.

window.PianoESP &&
        "function" == typeof window.PianoESP.handleUserDataPromise &&
        window.PianoESP.handleUserDataPromise
           ({ email: context.user.email, squads:
                [ mailing_list_ID0, mailing_list_ID1, ... ] });

Please replace the values mailing_list_ID0 and mailing_list_ID1 with the actual mailing list ID from your ESP dashboard.

Last updated: