Skip to content

Commit

Permalink
add disclaimers for attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
madjid-asa committed Nov 28, 2023
1 parent bdf209d commit 5eecd6d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lemarche/www/conversations/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
from lemarche.utils.emails import send_mail_async, whitelist_recipient_list


DISCLAIMER_ATTACHMENTS = (
"\nVeuillez noter que cette conversation email ne prend pas en charge les pièces jointes.\n"
"Pour envoyer un document, un devis ou autre, demandez les coordonnées direct de votre interlocuteur"
)


def send_first_email_from_conversation(conv: Conversation):
siae: Siae = conv.siae
from_email = f"{conv.sender_first_name} {conv.sender_last_name} <{conv.sender_email_buyer_encoded}>"
Expand All @@ -16,7 +22,7 @@ def send_first_email_from_conversation(conv: Conversation):
f"{sender_company_name}"
f"Ce client vous a contacté via le Marché de l'inclusion. "
"Pour échanger avec lui, répondez simplement à cet e-mail.\n"
)
) + DISCLAIMER_ATTACHMENTS

send_mail_async(
email_subject=conv.title,
Expand All @@ -34,7 +40,7 @@ def send_email_from_conversation(
from_email = f"{conv.sender_first_name} {conv.sender_last_name} <{conv.sender_email_buyer_encoded}>"
send_mail_async(
email_subject=email_subject,
email_body=email_body,
email_body=email_body + DISCLAIMER_ATTACHMENTS,
recipient_list=whitelist_recipient_list([conv.sender_email_siae]),
from_email=from_email,
email_body_html=email_body_html,
Expand All @@ -45,7 +51,7 @@ def send_email_from_conversation(
from_email = f"{siae.contact_full_name} <{conv.sender_email_siae_encoded}>"
send_mail_async(
email_subject=email_subject,
email_body=email_body,
email_body=email_body + DISCLAIMER_ATTACHMENTS,
recipient_list=whitelist_recipient_list([conv.sender_email_buyer]),
from_email=from_email,
email_body_html=email_body_html,
Expand Down

0 comments on commit 5eecd6d

Please sign in to comment.