Understanding User Preferences
User Preferences gives your users the ability to control which notification topics they receive, through the channels of their choice. This feature is designed to give your users control over their communication preferences and to help you comply with data privacy regulations like GDPR and CCPA. Your users can set their own preferences through the preferences hosted page, or they can be manually updated through the API.Configuring User Preferences
To create or edit a user’s preference, you will need to gather some important keys for the path parameters:- The recipient’s unique
user_idthat preferences are attached to. - The preference subscription
topic_idthat can be found in the preferences editor.
Configuring the Request Body
The preference request must contain atopic object with a required status parameter. One of the following statuses are required for each preference call made to a topic:
opted_in- The user is opted in to the topic and any notifications mapped to it.opted_out- The user is opted out of the topic and its corresponding notifications.required- The user cannot opt out of this topic and its notifications.
Preferences and Custom Routing
For Courier customers on the Enterprise plan, you have the ability to set acustom_routing object for your recipients. This object translates to channel delivery customization in the Preferences Center.
This configuration sets a specific channel delivery preference for each user. For example if a notification had 3 delivery channels (email, sms, push) and the recipient only wanted email, a request could be shaped like so:
custom_routing to work, the notification template must have multiple delivery channels configured and be part of a subscription topic.