Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def process(self):
author = self.obj.author
editor = self.obj.editor
chief_editor = self.obj.chief_editor
edit_url = admin_edit_url_for_object(self.obj)
send_email(
subject = _('A News Item has been published!'),
from_email = editor.email,
to = [u.email for u in User._default_manager.filter(groups__name=CHIEF_EDITORS_GROUP_NAME).only('email')],
context = {
'date_submitted': datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S"),
'url': edit_url,
'front_url': self.obj.get_absolute_url(),
'full_name': _("Team"),
'from_name': chief_editor.get_full_name(),
},
plain_template = 'news/emails/published_newsitem.txt',
html_template = 'news/emails/published_newsitem.html',
bcc = [author.email, editor.email]
)
def process(self):
author = self.obj.author
editor = self.obj.editor
chief_editor = self.obj.chief_editor
edit_url = admin_edit_url_for_object(self.obj)
send_email(
subject =_('A new News Item has been assigned to you'),
from_email = chief_editor.email,
to = [author.email, editor.email],
context = {
'date_submitted': datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%S"),
'url': edit_url,
'full_name': _("Writer/Editor"),
'from_name': chief_editor.get_full_name(),
},
plain_template = 'news/emails/new_newsitem.txt',
html_template = 'news/emails/new_newsitem.html'
)