Update event dimensions

This commit is contained in:
Adrià Casajús 2025-06-16 19:15:39 +02:00
parent 90dd2bd1db
commit 2871cf2a94
No known key found for this signature in database
GPG key ID: F0033226A5AFC9B9
2 changed files with 12 additions and 6 deletions

View file

@ -1829,9 +1829,13 @@ class Alias(Base, ModelMixin):
agent.record_custom_event(
"AliasCreated",
{
"custom_domain": "yes" if new_alias.custom_domain_id else "no",
"from_partner": "yes" if new_alias.is_created_from_partner() else "no",
"automatic": "yes" if new_alias.automatic_creation else "no",
"custom_domain": "custom domain"
if new_alias.custom_domain_id
else "base domain",
"from_partner": "from partner"
if new_alias.is_created_from_partner()
else "from sl",
"automatic": "automatic" if new_alias.automatic_creation else "manual",
},
)
@ -2111,8 +2115,8 @@ class Contact(Base, ModelMixin):
agent.record_custom_event(
"ContactCreated",
{
"is_cc": new_contact.is_cc,
"automatic": "yes" if new_contact.automatic_created else "no",
"is_cc": "cc" if new_contact.is_cc else "to",
"automatic": "automatic" if new_contact.automatic_created else "manual",
},
)

View file

@ -242,7 +242,9 @@ def get_or_create_reply_to_contact(
)
return None
return contact_utils.create_contact(contact_address, alias, contact_name).contact
return contact_utils.create_contact(
contact_address, alias, contact_name, automatic_created=True
).contact
def replace_header_when_forward(msg: Message, alias: Alias, header: str):