@@ -143,12 +143,12 @@ def create_notification_data(self, invitation) -> dict:
143143
144144 email_context = {
145145 "subject" : _ (
146- ' Invitation to the {project_type} project: " {project_name}"'
146+ " Invitation to the {project_type} project: {project_name}"
147147 ).format (project_type = project_type , project_name = project .name ),
148148 "headline" : _ (
149149 'Invitation to the {project_type} project: "{project_name}"'
150150 ).format (project_type = project_type , project_name = project .name ),
151- "cta_url" : f"https:// { invitation . site } { invitation .get_absolute_url ()} " ,
151+ "cta_url" : f"{ invitation .get_absolute_url ()} " ,
152152 "cta_label" : _ ("Accept invitation" ),
153153 "reason" : _ ("This email was sent to {receiver_email}." ),
154154 "content_template" : "a4_candy_notifications/emails/content/project_invitation.en.email" ,
@@ -298,17 +298,23 @@ def get_recipients(self, obj) -> List[User]:
298298 return self ._get_project_moderators (obj .project )
299299
300300 def create_notification_data (self , obj ) -> dict :
301- # Auto-detect content type from object class if not provided
302301 content_type = self .content_type or obj .__class__ .__name__
303- content_type_display = content_type # Could add display mapping if needed
304-
302+ content_type_display = content_type
303+ content_type_article = "A"
304+ if content_type_display [0 ].lower () in ["a" , "e" , "i" , "o" , "u" ]:
305+ content_type_article = "An"
305306 email_context = {
306- "subject" : _ ("A {content_type} was added to the project {project}" ).format (
307- content_type = content_type_display , project = obj .project .name
307+ "subject" : _ (
308+ "{article} {content_type} was added to the project {project}"
309+ ).format (
310+ article = content_type_article ,
311+ content_type = content_type_display ,
312+ project = obj .project .name ,
308313 ),
309314 "headline" : _ (
310- "{creator_name} created a {content_type} on the project {project}"
315+ "{creator_name} created {article} {content_type} on the project {project}"
311316 ).format (
317+ article = content_type_article .lower (),
312318 creator_name = obj .creator .username ,
313319 content_type = content_type_display ,
314320 project = obj .project .name ,
0 commit comments