8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-09-12 01:03:09 +00:00

Spécification du template de langue [oublie]

This commit is contained in:
Grizzly 2019-08-20 20:37:59 +00:00
parent 241c438f05
commit 675660b5f7

View file

@ -52,10 +52,17 @@ class Ticket(AclMixin, models.Model):
def publish_mail(self):
site_url = GeneralOption.objects.first().main_site_url
to_addr = Preferences.objects.first().publish_address
template = loader.get_template('tickets/publication_mail')
context = Context({'ticket':self,'site_url':site_url})
lang = Preferences.objects.first().mail_language
if(lang == 0):
obj = 'Nouvelle ouverture de ticket'
template = loader.get_template('tickets/publication_mail_fr')
else:
obj = 'New ticket opened'
template = loader.get_template('tickets/publication_mail_en')
send_mail(
'Nouvelle ouverture de ticket',
obj,
template.render(context),
GeneralOption.get_cached_value('email_from'),
[to_addr],