Security, Privacy, AI and CSR information for all Piano products now lives in one place. Explore our Compliance Center.
Subscriptions
English French
English French

How to use Composer to sign up users via API to a mailing list in ESP 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 code below 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: