pyconsk/django-konfera

Create function for email text formating

ricco386 opened this issue · 4 comments

Create function for email text formatting. Currently we use just format on python text which raises exception if in email body is variable unknown for the format. Therefore email is not send I think it is better to send untranslated variable in email as not send email at all.

so we want a tool to admin the email templates or just handle invalid format?

I was thinking to build a function in utils that will handle the whole email notification. In general we always have to check if setting is enabled, than collect the variables, format them and send the email, and check and log the exceptions. It seems that in this pattern for all emails several things are repeating.

My idea was to build a function that will do the email sending and handle all exceptions, and we will use this function for sending. eg. if mail is configured inappropriately if will fail here, if the format will wrong it will fail here, etc...

We should also update the admin area so admin is not allowed to store wrong email, but I would suggest that as a phase two ;) so it is not huge issue.

It seems interesting, I would like to take care about it

PR merged.