Example #1
0
 def notify(self, message=None, content=None):
     """ Send an email to ticket stakeholders notifying an state update """
     emails = self.get_notification_emails()
     template = 'issues/ticket_notification.mail'
     html_template = 'issues/ticket_notification_html.mail'
     context = {'ticket': self, 'ticket_message': message}
     send_email_template(template, context, emails, html=html_template)
Example #2
0
 def send_email(self, template, context, email_from=None, contacts=[], attachments=[], html=None):
     contacts = self.contacts.filter(email_usages=contacts)
     email_to = contacts.values_list("email", flat=True)
     extra_context = {"account": self, "email_from": email_from or djsettings.SERVER_EMAIL}
     extra_context.update(context)
     with translation.override(self.language):
         send_email_template(
             template, extra_context, email_to, email_from=email_from, html=html, attachments=attachments
         )
Example #3
0
 def notify(self, message=None, content=None):
     """ Send an email to ticket stakeholders notifying an state update """
     emails = self.get_notification_emails()
     template = 'issues/ticket_notification.mail'
     html_template = 'issues/ticket_notification_html.mail'
     context = {
         'ticket': self,
         'ticket_message': message
     }
     send_email_template(template, context, emails, html=html_template)
Example #4
0
 def send_email(self, template, context, email_from=None, usages=None, attachments=[], html=None):
     contacts = self.contacts.filter(email_usages=usages)
     email_to = self.get_contacts_emails(usages)
     extra_context = {
         'account': self,
         'email_from': email_from or djsettings.SERVER_EMAIL,
     }
     extra_context.update(context)
     with translation.override(self.language):
         send_email_template(template, extra_context, email_to, email_from=email_from,
             html=html, attachments=attachments)
Example #5
0
 def send_email(self,
                template,
                context,
                email_from=None,
                usages=None,
                attachments=[],
                html=None):
     contacts = self.contacts.filter(email_usages=usages)
     email_to = self.get_contacts_emails(usages)
     extra_context = {
         'account': self,
         'email_from': email_from or djsettings.SERVER_EMAIL,
     }
     extra_context.update(context)
     with translation.override(self.language):
         send_email_template(template,
                             extra_context,
                             email_to,
                             email_from=email_from,
                             html=html,
                             attachments=attachments)