def sendmail(recipients, sender='', msg='', subject='[No Subject]'): """send an html email as multipart with attachments and all""" send(get_email(recipients, sender, msg, subject))
def sendmail_to_system_managers(subject, content): send(get_email(get_system_managers(), None, content, subject))
msg=d.content, footer=footer) if send_me_a_copy: mail.cc.append(webnotes.conn.get_value("Profile", webnotes.session.user, "email")) if print_html: mail.add_attachment(name.replace(' ','').replace('/','-') + '.html', print_html) for a in json.loads(attachments): try: mail.attach_file(a) except IOError, e: webnotes.msgprint("""Unable to find attachment %s. Please resend without attaching this file.""" % a, raise_exception=True) send(mail) def set_portal_link(sent_via, comm): """set portal link in footer""" footer = None if is_signup_enabled() and hasattr(sent_via, "get_portal_page"): portal_page = sent_via.get_portal_page() if portal_page: is_valid_recipient = cstr(sent_via.doc.email or sent_via.doc.email_id or sent_via.doc.contact_email) in comm.recipients if is_valid_recipient: url = "%s/%s?name=%s" % (get_url(), portal_page, urllib.quote(sent_via.doc.name)) footer = """<!-- Portal Link --><hr> <a href="%s" target="_blank">View this on our website</a>""" % url