Email subscription
// This requires to have a custom user ID registered
// by calling the `identify` method beforehand.
Batch.Profile.editor()
.setEmailAddress("john.doe@batch.com") // Null to erase. Addresses must be valid.
.setEmailMarketingSubscription(BatchEmailSubscriptionState.SUBSCRIBED) // or BatchEmailSubscriptionState.UNSUBSCRIBED
.save();// This requires to have a custom user ID registered
// by calling the `identify` method beforehand.
Batch.Profile.editor().apply {
setEmailAddress("john.doe@batch.com") // Null to erase. Addresses must be valid.
setEmailMarketingSubscription(BatchEmailSubscriptionState.SUBSCRIBED) // or BatchEmailSubscriptionState.UNSUBSCRIBED
save()
}Last updated

