fix: braze track call for email address change (#30606)

This commit is contained in:
Waheed Ahmad
2022-06-16 16:48:16 +05:00
committed by GitHub
parent e35f98265d
commit 868505dbb8

View File

@@ -109,11 +109,11 @@ def _listen_for_user_email_changed(sender, user, **kwargs):
""" If user has changed their email, update that in email Braze. """
email = user.email
user_id = user.id
attributes = {'email': email, 'external_id': user_id}
attributes = [{'email': email, 'external_id': user_id}]
try:
braze_client = get_braze_client()
if braze_client:
braze_client.track_user(attributes=attributes)
except Exception as exc: # pylint: disable=broad-except
logger.warning(f'Unable to sync new email [{email}] with Braze for user [{user_id}]: {str(exc)}')
logger.exception(f'Unable to sync new email [{email}] with Braze for user [{user_id}]')