def send_published_article(date_string, sender, recipient, subject, byline, email_text, story_text, attachment=None): """ Task for sending each email, gets called by create_email_batch """ email = EMail(subject, recipient) ctx = {'subject': subject, 'story_text': story_text, 'email_text': email_text, 'byline': byline} email.text('../templates/templated_email/emaila.txt', ctx) email.html('../templates/templated_email/emaila.html', ctx) if attachment: email.add_attachment(attachment) email.send()
def send_published_article( date_string, sender, recipient, subject, byline, email_text, story_text, mediaitems=None, attachment=None ): """ Task for sending each email, gets called by create_email_batch """ email = EMail(subject, recipient) ctx = { "subject": subject, "story_text": story_text, "email_text": email_text, "byline": byline, "mediaitems": mediaitems, } email.text("../templates/templated_email/emaila.txt", ctx) email.html("../templates/templated_email/emaila.html", ctx) if attachment: email.add_attachment(attachment) email.send()
def send_published_article(date_string, sender, recipient, subject, byline, email_text, story_text, attachment=None): """ Task for sending each email, gets called by create_email_batch """ email = EMail(subject, recipient) ctx = { 'subject': subject, 'story_text': story_text, 'email_text': email_text, 'byline': byline } email.text('../templates/templated_email/emaila.txt', ctx) email.html('../templates/templated_email/emaila.html', ctx) if attachment: email.add_attachment(attachment) email.send()