-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Emails): avoir les logs d'envois des TemplateTransactional (#1337)
- Loading branch information
Showing
11 changed files
with
208 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
lemarche/conversations/migrations/0016_templatetransactionalsendlog.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Generated by Django 4.2.13 on 2024-07-15 10:43 | ||
|
||
import django.db.models.deletion | ||
import django.utils.timezone | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("contenttypes", "0002_remove_content_type_name"), | ||
("conversations", "0015_remove_templatetransactional_email_from_email_and_more"), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name="TemplateTransactionalSendLog", | ||
fields=[ | ||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")), | ||
("object_id", models.PositiveBigIntegerField(blank=True, null=True)), | ||
("extra_data", models.JSONField(default=dict, editable=False, verbose_name="Données complémentaires")), | ||
( | ||
"created_at", | ||
models.DateTimeField(default=django.utils.timezone.now, verbose_name="Date de création"), | ||
), | ||
("updated_at", models.DateTimeField(auto_now=True, verbose_name="Date de modification")), | ||
( | ||
"content_type", | ||
models.ForeignKey( | ||
blank=True, | ||
null=True, | ||
on_delete=django.db.models.deletion.CASCADE, | ||
to="contenttypes.contenttype", | ||
), | ||
), | ||
( | ||
"template_transactional", | ||
models.ForeignKey( | ||
null=True, | ||
on_delete=django.db.models.deletion.SET_NULL, | ||
related_name="send_logs", | ||
to="conversations.templatetransactional", | ||
verbose_name="Template transactionnel", | ||
), | ||
), | ||
], | ||
options={ | ||
"verbose_name": "Template transactionnel: logs d'envois", | ||
"verbose_name_plural": "Templates transactionnels: logs d'envois", | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
lemarche/templates/tenders/cocontracting_notification_email_admin_body.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
La structure {{ siae_name|safe }} souhaite répondre en co-traitance | ||
La structure {{ SIAE_NAME|safe }} souhaite répondre en co-traitance | ||
|
||
Titre : {{ tender_title|safe }} | ||
Type : {{ tender_kind|safe }} | ||
Contact email de l'ESI: {{ siae_contact_email|safe }} | ||
SIRET : {{ siae_siret|safe }} | ||
Titre : {{ TENDER_TITLE|safe }} | ||
Type : {{ TENDER_KIND|safe }} | ||
Contact email de l'ESI: {{ SIAE_CONTACT_EMAIL|safe }} | ||
SIRET : {{ SIAE_SIRET|safe }} | ||
|
||
Lien dans l'admin : {{ tender_admin_url }} | ||
Lien dans l'admin : {{ TENDER_ADMIN_URL }} |
22 changes: 11 additions & 11 deletions
22
lemarche/templates/tenders/create_notification_email_admin_body.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
Dépôt de besoin : ajout d'un nouveau {{ tender_kind|safe }} | ||
Dépôt de besoin : ajout d'un nouveau {{ TENDER_KIND|safe }} | ||
|
||
titre : {{ tender_title|safe }} | ||
type : {{ tender_kind|safe }} | ||
lieu d'intervention : {{ tender_location|safe }} | ||
date de clôture des réponses : {{ tender_deadline_date|safe }} | ||
contact : {{ tender_author_full_name|safe }} | ||
entreprise : {{ tender_author_company|safe }} | ||
si le Marché n'existait pas, auriez-vous consulté des prestataires inclusifs ? : {{ tender_scale_marche_useless|safe }} | ||
status : {{ tender_status|safe }} | ||
source: {{ tender_source|safe }} | ||
titre : {{ TENDER_TITLE|safe }} | ||
type : {{ TENDER_KIND|safe }} | ||
lieu d'intervention : {{ TENDER_LOCATION|safe }} | ||
date de clôture des réponses : {{ TENDER_DEADLINE_DATE|safe }} | ||
contact : {{ TENDER_AUTHOR_FULL_NAME|safe }} | ||
entreprise : {{ TENDER_AUTHOR_COMPANY|safe }} | ||
si le Marché n'existait pas, auriez-vous consulté des prestataires inclusifs ? : {{ TENDER_SCALE_MARCHE_USELESS|safe }} | ||
status : {{ TENDER_STATUS|safe }} | ||
source: {{ TENDER_SOURCE|safe }} | ||
|
||
Lien dans l'admin : {{ tender_admin_url }} | ||
Lien dans l'admin : {{ TENDER_ADMIN_URL }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -343,7 +343,8 @@ def send_transactional_email_with_template( | |
send_smtp_email = sib_api_v3_sdk.SendSmtpEmail(**data) | ||
response = api_instance.send_transac_email(send_smtp_email) | ||
logger.info("Brevo: send transactional email with template") | ||
return response | ||
# {'message_id': '<[email protected]>', 'message_ids': None} | ||
return response.to_dict() | ||
except ApiException as e: | ||
print(f"Exception when calling SMTPApi->send_transac_email: {e}") | ||
else: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.