From 4648c9e8382e1a3b3c0fe9b9883ab85a7cd31123 Mon Sep 17 00:00:00 2001 From: Raphael Odini Date: Mon, 13 May 2024 16:55:37 +0200 Subject: [PATCH] Brevo: on signup, add Siae user to Brevo contact list --- config/settings/base.py | 3 ++- lemarche/utils/emails.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/settings/base.py b/config/settings/base.py index 0d43659c9..84d6f77e2 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -364,9 +364,10 @@ ) -# -- Sendinblue (BREVO) +# -- Sendinblue (Brevo) BREVO_API_KEY = env.str("BREVO_API_KEY", "set-it") BREVO_CL_SIGNUP_BUYER_ID = env.int("BREVO_CL_SIGNUP_BUYER_ID", 10) +BREVO_CL_SIGNUP_SIAE_ID = env.int("BREVO_CL_SIGNUP_SIAE_ID", 27) BREVO_CL_BUYER_SEARCH_SIAE_LIST_ID = env.int("BREVO_CL_BUYER_SEARCH_SIAE_LIST_ID", 12) INBOUND_PARSING_DOMAIN_EMAIL = env.str("INBOUND_PARSING_DOMAIN_EMAIL", "reply.staging.lemarche.inclusion.beta.gouv.fr") diff --git a/lemarche/utils/emails.py b/lemarche/utils/emails.py index f0f6c6dec..f68972011 100644 --- a/lemarche/utils/emails.py +++ b/lemarche/utils/emails.py @@ -67,6 +67,8 @@ def add_to_contact_list(user, type: str, source: str = user_constants.SOURCE_SIG # TODO: we still use it ? api_hubspot.add_user_to_crm(user) api_brevo.create_contact(user=user, list_id=settings.BREVO_CL_SIGNUP_BUYER_ID) + elif user.kind == user.KIND_SIAE: + api_brevo.create_contact(user=user, list_id=settings.BREVO_CL_SIGNUP_SIAE_ID) elif type == "buyer_search": # contact_list_id = settings.MAILJET_NL_CL_BUYER_SEARCH_SIAE_LIST_ID api_brevo.create_contact(user=user, list_id=settings.BREVO_CL_BUYER_SEARCH_SIAE_LIST_ID)