Email subscription
batchSDK(async api => {
const profile = await api.profile();
// This requires to have a custom user ID registered
await profile.identify({customId: "custom_user_id"});
await profile.edit(editor => {
editor
.setEmailAddress("john.doe@batch.com") // Null to erase. Addresses must be valid.
.setEmailMarketingSubscription("subscribed") // Or "unsubscribed"
})
});batchSDK(api => {
api.profile().then(profile => {
profile.identify({customId: "custom_user_id"}).then(profile => {
profile.edit(editor => {
editor
.setEmailAddress("john.doe@batch.com") // Null to erase. Addresses must be valid.
.setEmailMarketingSubscription("subscribed") // Or "unsubscribed"
})
})
})
});Last updated

