Skip to content

Braze: Fix - No remove OldEid and subscribe new users to email notifications#2152

Merged
JohnathanWhite merged 2 commits into
bitpay:developfrom
cmgustavo:bug/braze-email-subscription-01
Apr 30, 2026
Merged

Braze: Fix - No remove OldEid and subscribe new users to email notifications#2152
JohnathanWhite merged 2 commits into
bitpay:developfrom
cmgustavo:bug/braze-email-subscription-01

Conversation

@cmgustavo

@cmgustavo cmgustavo commented Apr 23, 2026

Copy link
Copy Markdown
Member

Commit f305ce4

New users could end up with UNSUBSCRIBED email status in Braze because agreedToMarketingCommunications was propagated through the pairing chain and used to gate the setEmailNotifications call.
Now setEmailNotificationsAccepted(true) is dispatched immediately after account creation, and the agreedToMarketingCommunications parameter is removed from the chain.

The OPTED_IN vs SUBSCRIBED distinction is determined solely by the BitPay user's optInEmailMarketing + verified flags.

RN-2700


Commit a823539

Anonymous Braze tracking data was not migrating to the authenticated user profile on login.

Root cause

Braze.changeUser(newEid) and the server-side merge were called in the wrong order, and buffered SDK events were never flushed before switching users.

Fix

Added Braze.requestImmediateDataFlush() before Braze.changeUser() in BrazeWrapper.identify to flush buffered anonymous events to Braze servers first.
Reordered the login flow so identify (→ changeUser) runs before the server-side merge API call.
Removed programmatic delete of the anonymous profile — it races against Braze's async merge and can cancel it. The empty shell is harmless and handled by Braze's User Archival policy.

RN-2699

@cmgustavo
cmgustavo force-pushed the bug/braze-email-subscription-01 branch from 1559b8d to f305ce4 Compare April 24, 2026 16:34
gabrielbazan7
gabrielbazan7 previously approved these changes Apr 24, 2026

@gabrielbazan7 gabrielbazan7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@cmgustavo cmgustavo changed the title Braze: Fix - Ensure new users start with email notifications subscribed Braze: Fix - No remove OldEid and subscribe new users to email notifications Apr 24, 2026
@cmgustavo
cmgustavo force-pushed the bug/braze-email-subscription-01 branch from ed6dba5 to cd6272d Compare April 24, 2026 19:12

@gabrielbazan7 gabrielbazan7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@JohnathanWhite
JohnathanWhite merged commit a9001f5 into bitpay:develop Apr 30, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants