Skip to content

Commit

Permalink
refactor: améliorations mineures appel à l'API Brevo (#838)
Browse files Browse the repository at this point in the history
## Description

🎸 mise à jour de `DEFAULT_FROM_EMAIL` en `[email protected]`
🎸 suppression d'un param statique dans l'appel au gabarit
`SIB_NEW_MESSAGE_TEMPLATE`

## Type de changement

🚧 technique
  • Loading branch information
vincentporte authored Dec 2, 2024
1 parent 300a7bd commit e929c19
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@
SIB_CONTACTS_URL = os.path.join(SIB_URL, "contacts/import")

SIB_API_KEY = os.getenv("SIB_API_KEY", "set-sib-api-key")
DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL", "noreply@inclusion.beta.gouv.fr")
DEFAULT_FROM_EMAIL = os.getenv("DEFAULT_FROM_EMAIL", "[email protected]")

SIB_MAGIC_LINK_TEMPLATE = 31
SIB_UNANSWERED_QUESTION_TEMPLATE = 10
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/notification/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def get_grouped_notifications():
message_count_text = f"{message_count} message{pluralize(message_count, 's')}"

params = {
"email_object": "Bonne nouvelle, ça bouge pour vous dans la communauté !",
"email_thumbnail": (f"Vous avez {message_count_text} à découvrir sur la communauté de l'inclusion"),
"messages": get_serialized_messages(recipient_notifications[:NEW_MESSAGES_EMAIL_MAX_PREVIEW]),
}
Expand Down
1 change: 0 additions & 1 deletion lacommunaute/notification/tests/tests_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ def get_expected_email_payload(self, notifications):
message_count_text = f"{message_count} message{pluralize(message_count, 's')}"

params = {
"email_object": "Bonne nouvelle, ça bouge pour vous dans la communauté !",
"email_thumbnail": (f"Vous avez {message_count_text} à découvrir sur la communauté de l'inclusion"),
"messages": get_serialized_messages(recipient_notifications[:NEW_MESSAGES_EMAIL_MAX_PREVIEW]),
}
Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/users/tests/__snapshots__/tests_views.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,8 @@
'''
# ---
# name: TestSendMagicLink.test_send_magic_link[DEV-1][send_magic_link_payload]
'{"sender": {"name": "La Communaut\\u00e9", "email": "noreply@inclusion.beta.gouv.fr"}, "to": [{"email": "[email protected]"}], "params": {"display_name": "Samuel J.", "login_link": "LOGIN_LINK"}, "templateId": 31}'
'{"sender": {"name": "La Communaut\\u00e9", "email": "[email protected]"}, "to": [{"email": "[email protected]"}], "params": {"display_name": "Samuel J.", "login_link": "LOGIN_LINK"}, "templateId": 31}'
# ---
# name: TestSendMagicLink.test_send_magic_link[PROD-0][send_magic_link_payload]
'{"sender": {"name": "La Communaut\\u00e9", "email": "noreply@inclusion.beta.gouv.fr"}, "to": [{"email": "[email protected]"}], "params": {"display_name": "Samuel J.", "login_link": "LOGIN_LINK"}, "templateId": 31}'
'{"sender": {"name": "La Communaut\\u00e9", "email": "[email protected]"}, "to": [{"email": "[email protected]"}], "params": {"display_name": "Samuel J.", "login_link": "LOGIN_LINK"}, "templateId": 31}'
# ---

0 comments on commit e929c19

Please sign in to comment.