diff --git a/app/clients/freshdesk.py b/app/clients/freshdesk.py index 66c97546fa..fd0ecc978b 100644 --- a/app/clients/freshdesk.py +++ b/app/clients/freshdesk.py @@ -62,6 +62,9 @@ def _generate_description(self): f"- Organisation id: {self.contact.organisation_id}", f"- Organisation name: {self.contact.department_org_name}", f"- Logo filename: {self.contact.branding_url}", + f"- Logo name: {self.contact.branding_logo_name}", + f"- Alt text english: {self.contact.alt_text_en}", + f"- Alt text french: {self.contact.alt_text_fr}", "
", f"Un nouveau logo a été téléchargé par {self.contact.name} ({self.contact.email_address}) pour le service suivant :", f"- Identifiant du service : {self.contact.service_id}", @@ -69,6 +72,9 @@ def _generate_description(self): f"- Identifiant de l'organisation: {self.contact.organisation_id}", f"- Nom de l'organisation: {self.contact.department_org_name}", f"- Nom du fichier du logo : {self.contact.branding_url}", + f"- Nom du logo : {self.contact.branding_logo_name}", + f"- Texte alternatif anglais : {self.contact.alt_text_en}", + f"- Texte alternatif français : {self.contact.alt_text_fr}", ] ) diff --git a/app/user/contact_request.py b/app/user/contact_request.py index 74c5a96a35..cfca30cafb 100644 --- a/app/user/contact_request.py +++ b/app/user/contact_request.py @@ -31,6 +31,7 @@ class ContactRequest: notification_types: str = field(default="") expected_volume: str = field(default="") branding_url: str = field(default="") + branding_logo_name: str = field(default="") alt_text_en: str = field(default="") alt_text_fr: str = field(default="") diff --git a/app/user/rest.py b/app/user/rest.py index a80e280548..ea28646d41 100644 --- a/app/user/rest.py +++ b/app/user/rest.py @@ -500,6 +500,7 @@ def send_branding_request(user_id): organisation_id=data["organisation_id"], department_org_name=data["organisation_name"], branding_url=get_logo_url(data["filename"]), + branding_logo_name=data["branding_logo_name"] if "branding_logo_name" in data else "", alt_text_en=data["alt_text_en"], alt_text_fr=data["alt_text_fr"], ) diff --git a/tests/app/clients/test_freshdesk.py b/tests/app/clients/test_freshdesk.py index a3e0713d5f..3e8b56227d 100644 --- a/tests/app/clients/test_freshdesk.py +++ b/tests/app/clients/test_freshdesk.py @@ -130,13 +130,19 @@ def match_json(request): "- Organisation id: 6b72e84f-8591-42e1-93b8-7d24a45e1d79
" "- Organisation name: best org name ever
" "- Logo filename: branding_url
" + "- Logo name: branding_logo_name
" + "- Alt text english: en alt text
" + "- Alt text french: fr alt text
" "

" "Un nouveau logo a été téléchargé par name (test@email.com) pour le service suivant :
" "- Identifiant du service : 8624bd36-b70b-4d4b-a459-13e1f4770b92
" "- Nom du service : t6
" "- Identifiant de l'organisation: 6b72e84f-8591-42e1-93b8-7d24a45e1d79
" "- Nom de l'organisation: best org name ever
" - "- Nom du fichier du logo : branding_url", + "- Nom du fichier du logo : branding_url
" + "- Nom du logo : branding_logo_name
" + "- Texte alternatif anglais : en alt text
" + "- Texte alternatif français : fr alt text", "email": "test@email.com", "priority": 1, "status": 2, @@ -166,6 +172,9 @@ def match_json(request): "department_org_name": "best org name ever", "service_id": "8624bd36-b70b-4d4b-a459-13e1f4770b92", "branding_url": "branding_url", + "branding_logo_name": "branding_logo_name", + "alt_text_en": "en alt text", + "alt_text_fr": "fr alt text", } with notify_api.app_context(): response = freshdesk.Freshdesk(ContactRequest(**data)).send_ticket()