Method Objective

The method allows changing the status of the current user's subscriptions to notification channels.

Syntax and parameters

sdk.manageSubscription(email, phone, external_id, loyalty_id, telegram_id, HashMap<String, Boolean>)

Request parameters

NameRequirementDescription
emailoptionallyThe current user's Email.
phoneoptionally

The current user's Phone.

external_idoptionallyStore side user ID.
loyalty_idoptionallyThe Loyalty Program user ID (loyalty card).
telegram_idoptionallyThe current user's Telegram ID.
HashMap<String, Boolean>requiredSubscription Statuses. See the example below.

Available subscription statuses

NameRequirementDescription
email_bulkoptionallyIt changes the current user's subscription status to bulk email campaigns.
email_chainoptionallyIt changes the current user's subscription status to triggered email campaigns.
email_transactionaloptionally

It changes the current user's subscription status for transactional email campaigns.

It's recommended that always use the "true" value, even if you don't use transactional messages.


sms_bulkoptionallyIt changes the current user's subscription status to bulk SMS campaigns.
sms_chainoptionallyIt changes the current user's subscription status to triggered SMS campaigns.
sms_transactionaloptionally

It changes the current user's subscription status for transactional SMS campaigns.

It's recommended that always use the "true" value, even if you don't use transactional messages.


web_push_bulkoptionallyIt changes the current user's subscription status to bulk webpush campaigns.
web_push_chainoptionallyIt changes the current user's subscription status to triggered webpush campaigns.
web_push_transactionaloptionally

It changes the current user's subscription status for transactional webpush campaigns.

It's recommended that always use the "true" value, even if you don't use transactional messages.


mobile_push_bulkoptionallyIt changes the current user's subscription status to bulk app campaigns.
mobile_push_chainoptionallyIt changes the current user's subscription status to triggered app campaigns.
mobile_push_transactionaloptionally

It changes the current user's subscription status for transactional app campaigns.

It's recommended that always use the "true" value, even if you don't use transactional messages.


Examples of use

val subscriptions = HashMap<String, Boolean>()
subscriptions["email_bulk"] = true
subscriptions["email_chain"] = true
subscriptions["email_transactional"] = true
subscriptions["sms_bulk"] = true
subscriptions["sms_chain"] = true
subscriptions["sms_transactional"] = true
subscriptions["web_push_bulk"] = true
subscriptions["web_push_chain"] = true
subscriptions["web_push_transactional"] = true
subscriptions["mobile_push_bulk"] = true
subscriptions["mobile_push_chain"] = true
subscriptions["mobile_push_transactional"] = true
sdk.manageSubscription("john.doe@examplestore.com", "+100000000000", "100500", "12345-abcdf", 12345678, subscriptions)

val subscriptions = HashMap<String, Boolean>()
subscriptions["email_bulk"] = true
subscriptions["email_chain"] = false
subscriptions["email_transactional"] = true
sdk.manageSubscription("john.doe@examplestore.com", null, null, null, null, subscriptions)

val subscriptions = HashMap<String, Boolean>()
subscriptions["sms_bulk"] = false
subscriptions["sms_chain"] = false
subscriptions["sms_transactional"] = true
sdk.manageSubscription(null, "+100000000000", null, null, null, subscriptions)

val subscriptions = HashMap<String, Boolean>()
subscriptions["email_transactional"] = true
subscriptions["sms_transactional"] = true
sdk.manageSubscription(null, null, null, null, null, subscriptions)



Page Navigation




Related Pages