Commit c71b9389 authored by Patrick's avatar Patrick

Add a third producer email address. Asked by Gac-Hamois.

parent e2d47270
......@@ -60,10 +60,13 @@ def send_invoice(permanence_id):
signature, sender_function, REPANIER_SETTINGS_GROUP_NAME))
})
html_content = template.render(context)
to_email_producer = []
if producer.email:
to_email_producer.append(producer.email)
if producer.email2:
to_email_producer = [producer.email, producer.email2]
else:
to_email_producer = [producer.email]
to_email_producer.append(producer.email2)
if producer.email3:
to_email_producer.append(producer.email3)
email = EmailMultiAlternatives(
invoice_producer_mail_subject,
strip_tags(html_content),
......
......@@ -64,10 +64,13 @@ def send_pre_open_order(permanence_id):
)
})
html_content = template.render(context)
to_email_producer = []
if producer.email:
to_email_producer.append(producer.email)
if producer.email2:
to_email_producer = [producer.email, producer.email2]
else:
to_email_producer = [producer.email]
to_email_producer.append(producer.email2)
if producer.email3:
to_email_producer.append(producer.email3)
email = EmailMultiAlternatives(
offer_producer_mail_subject,
strip_tags(html_content),
......
......@@ -165,16 +165,19 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr
order_producer_mail_subject = _(
'/!\ Mail not send to our producer %s because the minimum order value has not been reached.') % long_profile_name
else:
to_email_producer = []
if producer.email:
to_email_producer.append(producer.email)
if producer.email2:
to = [producer.email, producer.email2]
else:
to = [producer.email]
to_email_producer.append(producer.email2)
if producer.email3:
to_email_producer.append(producer.email3)
cc = cc_email_staff
email = EmailMultiAlternatives(
order_producer_mail_subject,
strip_tags(html_content),
from_email=sender_email,
to=to,
to=to_email_producer,
cc=cc
)
if REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_PRODUCER and wb is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment