temp: logs for unsubscribe event (#35652)
This commit is contained in:
committed by
GitHub
parent
c3d68b13f8
commit
e28a01e2bf
@@ -3,6 +3,7 @@ Email Notifications Utils
|
||||
"""
|
||||
import datetime
|
||||
import json
|
||||
import logging
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
from django.conf import settings
|
||||
@@ -31,6 +32,7 @@ from .notification_icons import NotificationTypeIcons
|
||||
|
||||
|
||||
User = get_user_model()
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def is_email_notification_flag_enabled(user=None):
|
||||
@@ -411,4 +413,6 @@ def update_user_preferences_from_patch(encrypted_username, encrypted_patch):
|
||||
if pref_value else EmailCadence.NEVER
|
||||
type_prefs['email_cadence'] = cadence_value
|
||||
preference.save()
|
||||
if not user.id:
|
||||
log.info(f"<Digest-One-Click-Unsubscribe> - user.id is null - {encrypted_username} ")
|
||||
notification_preference_unsubscribe_event(user)
|
||||
|
||||
@@ -167,6 +167,5 @@ def notification_preference_unsubscribe_event(user):
|
||||
'username': user.username,
|
||||
'event_type': 'email_digest_unsubscribe'
|
||||
}
|
||||
with tracker.get_tracker().context(NOTIFICATION_PREFERENCE_UNSUBSCRIBE, event_data):
|
||||
tracker.emit(NOTIFICATION_PREFERENCE_UNSUBSCRIBE, event_data)
|
||||
segment.track(user.id, NOTIFICATION_PREFERENCE_UNSUBSCRIBE, event_data)
|
||||
tracker.emit(NOTIFICATION_PREFERENCE_UNSUBSCRIBE, event_data)
|
||||
segment.track(user.id, NOTIFICATION_PREFERENCE_UNSUBSCRIBE, event_data)
|
||||
|
||||
Reference in New Issue
Block a user