Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CO-2975: Allow recipients to be specified via email - MERGE 10/8 #8164

Merged
merged 4 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@ Authorization: Bearer YOUR-REST-API-KEY
"recipients": (optional, array; if not provided and broadcast is not set to `false`, message will send to the entire segment targeted by the campaign)
[
{
// Either "external_user_id" or "user_alias" is required. Requests must specify only one.
// Either "external_user_id" or "user_alias" or "email" is required. Requests must specify only one.
"user_alias": (optional, user alias object) user alias of user to receive message,
"external_user_id": (optional, string) external identifier of user to receive message,
"email": (optional, string) email address of user to receive message,
"prioritization": (optional, array) prioritization array; required when using email,
"trigger_properties": (optional, object) personalization key-value pairs that will apply to this user (these key-value pairs will override any keys that conflict with the parent trigger_properties),
"send_to_existing_only": (optional, boolean) defaults to true, can't be used with user aliases; if set to `false`, an attributes object must also be included,
"attributes": (optional, object) fields in the attributes object will create or update an attribute of that name with the given value on the specified user profile before the message is sent and existing values will be overwritten
Expand Down Expand Up @@ -83,6 +85,10 @@ Authorization: Bearer YOUR-REST-API-KEY
- When `send_to_existing_only` is `true`, Braze will only send the message to existing users. However, this flag can't be used with user aliases.
- When `send_to_existing_only` is `false`, an attribute must be included. Braze will create a user with the `id` and attributes before sending the message.

+{% alert important %}
+Specifying a recipient via email address is currently in early access. Contact your customer success manager if you're interested in participating in this early access.
+{% endalert %}

A user's subscription group status can be updated via the inclusion of a `subscription_groups` parameter within the `attributes` object. For more details, refer to [User attributes object]({{site.baseurl}}/api/objects_filters/user_attributes_object).

## Example request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ Authorization: Bearer YOUR-REST-API-KEY
// Including 'audience' will only send to users in the audience
"recipients": (optional, array; if not provided and broadcast is not set to 'false', message will send to the entire segment targeted by the Canvas)
[{
// Either "external_user_id" or "user_alias" is required. Requests must specify only one.
// Either "external_user_id" or "user_alias" or "email" is required. Requests must specify only one.
"user_alias": (optional, user alias object) user alias of user to receive message,
"external_user_id": (optional, string) external identifier of user to receive message,
"email": (optional, string) email address of user to receive message,
"prioritization": (optional, array) prioritization array; required when using email,
"canvas_entry_properties": (optional, object) personalization key-value pairs that will apply to this user (these key-value pairs will override any keys that conflict with the parent `canvas_entry_properties`)
"send_to_existing_only": (optional, boolean) defaults to true, can't be used with user aliases
"attributes": (optional, object) fields in the attributes object will create or update an attribute of that name with the given value on the specified user profile before the message is sent and existing values will be overwritten
Expand All @@ -70,6 +72,10 @@ Authorization: Bearer YOUR-REST-API-KEY

Customers using the API for server-to-server calls may need to allowlist the appropriate API URL if they're behind a firewall.

+{% alert important %}
+Specifying a recipient via email address is currently in early access. Contact your customer success manager if you're interested in participating in this early access.
+{% endalert %}

{% alert note %}
If you include both specific users in your API call and a target segment in the dashboard, the message will send to specifically the user profiles that are both in the API call and qualify for the segment filters.
{% endalert %}
Expand Down
9 changes: 8 additions & 1 deletion _docs/_api/objects_filters/recipient_object.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ description: "This reference article explains the different components of the Br

> The recipients object allows you to request or write information in our endpoints.

Either `external_user_id` or `user_alias` is required in this object. **Requests must specify only one.**
Either `external_user_id`, `user_alias`, or `email` is required in this object. **Requests must specify only one.**

{% alert important %}
Specifying a recipient via email address is currently in early access. Contact your customer success manager if you're interested in participating in this early access.
{% endalert %}

The recipients object allows you to combine the [user alias object]({{site.baseurl}}/api/objects_filters/user_alias_object/), the [trigger properties object]({{site.baseurl}}/api/objects_filters/trigger_properties_object/), and the [Canvas entry properties object]({{site.baseurl}}/api/objects_filters/canvas_entry_properties_object/).

Expand All @@ -21,13 +25,16 @@ The recipients object allows you to combine the [user alias object]({{site.baseu
[{
"user_alias": (optional, User Alias Object) User alias of user to receive message,
"external_user_id": (optional, string) see External user ID,
"email": (optional, string) email address of user to receive message,
"prioritization": (optional, array) see Prioritization; required when using email,
"trigger_properties": (optional, object) personalization key-value pairs for this user when sending a campaign or message; see Trigger Properties,
"canvas_entry_properties": (optional, object) personalization key-value pairs for this user when triggering a Canvas; see Canvas Entry Properties
}]
```

- [User aliases]({{site.baseurl}}/user_guide/data_and_analytics/user_data_collection/user_profile_lifecycle/#user-aliases)
- [External user ID]({{site.baseurl}}/api/objects_filters/user_attributes_object/#braze-user-profile-fields)
- [Prioritization]({{site.baseurl}}/api/endpoints/user_data/post_user_identify/#identifying-users-by-email)

## Recipient object deduping

Expand Down