|
|
@@ -9,20 +9,22 @@ from frappe.email.smtp import send |
|
|
|
from frappe.utils import markdown |
|
|
|
|
|
|
|
def sendmail_md(recipients, sender=None, msg=None, subject=None, attachments=None, content=None, |
|
|
|
reply_to=None, cc=(), message_id=None, in_reply_to=None): |
|
|
|
reply_to=None, cc=(), message_id=None, in_reply_to=None, retry=1): |
|
|
|
"""send markdown email""" |
|
|
|
sendmail(recipients, sender, markdown(content or msg), subject, attachments, reply_to=reply_to, cc=cc) |
|
|
|
sendmail(recipients, sender, markdown(content or msg), subject, attachments, |
|
|
|
reply_to=reply_to, cc=cc, retry=retry) |
|
|
|
|
|
|
|
def sendmail(recipients, sender='', msg='', subject='[No Subject]', attachments=None, content=None, |
|
|
|
reply_to=None, cc=(), message_id=None, in_reply_to=None): |
|
|
|
reply_to=None, cc=(), message_id=None, in_reply_to=None, retry=1): |
|
|
|
"""send an html email as multipart with attachments and all""" |
|
|
|
mail = get_email(recipients, sender, content or msg, subject, attachments=attachments, reply_to=reply_to, cc=cc) |
|
|
|
mail = get_email(recipients, sender, content or msg, subject, attachments=attachments, |
|
|
|
reply_to=reply_to, cc=cc) |
|
|
|
if message_id: |
|
|
|
mail.set_message_id(message_id) |
|
|
|
if in_reply_to: |
|
|
|
mail.set_in_reply_to(in_reply_to) |
|
|
|
|
|
|
|
send(mail) |
|
|
|
send(mail, retry=retry) |
|
|
|
|
|
|
|
def sendmail_to_system_managers(subject, content): |
|
|
|
send(get_email(get_system_managers(), None, content, subject)) |
|
|
|