示例#1
0
def send_postmark(to="", bcc="", subject="", plaintext=""):
    """
    Send an email via Postmark. Used when the application is deployed on
    Heroku.
    """
    try:
        message = PMMail(api_key = conf.POSTMARK_API_KEY,
                        subject = subject,
                        sender = conf.NOTIFICATION_EMAIL,
                        text_body = plaintext)
        message.to = to
        if bcc != "":
            message.bcc = bcc
        message.send()
    except Exception as e:
        logger.exception("send_postmark raised:")
        raise e
示例#2
0
def send_postmark(to="", bcc="", subject="", plaintext=""):
    """
    Send an email via Postmark. Used when the application is deployed on
    Heroku.
    """
    try:
        message = PMMail(api_key=conf.POSTMARK_API_KEY,
                         subject=subject,
                         sender=conf.NOTIFICATION_EMAIL,
                         text_body=plaintext)
        message.to = to
        if bcc != "":
            message.bcc = bcc
        message.send()
    except Exception as e:
        logger.exception("send_postmark raised:")
        raise e
示例#3
0
文件: emails.py 项目: sabite/newspipe
def send_postmark(to="", bcc="", subject="", plaintext=""):
    """
    Send an email via Postmark. Used when the application is deployed on
    Heroku.
    Note: The Postmark team has chosen not to continue development of the
    Heroku add-on as of June 30, 2017. Newspipe is now using SendGrid when
    deployed on Heroku.
    """
    from postmark import PMMail
    try:
        message = PMMail(api_key=conf.POSTMARK_API_KEY,
                         subject=subject,
                         sender=conf.NOTIFICATION_EMAIL,
                         text_body=plaintext)
        message.to = to
        if bcc != "":
            message.bcc = bcc
        message.send()
    except Exception as e:
        logger.exception('send_postmark raised:')
        raise e
示例#4
0
文件: emails.py 项目: JARR/JARR
def send_postmark(to="", bcc="", subject="", plaintext=""):
    """
    Send an email via Postmark. Used when the application is deployed on
    Heroku.
    Note: The Postmark team has chosen not to continue development of the
    Heroku add-on as of June 30, 2017. Newspipe is now using SendGrid when
    deployed on Heroku.
    """
    from postmark import PMMail
    try:
        message = PMMail(api_key = conf.POSTMARK_API_KEY,
                        subject = subject,
                        sender = conf.NOTIFICATION_EMAIL,
                        text_body = plaintext)
        message.to = to
        if bcc != "":
            message.bcc = bcc
        message.send()
    except Exception as e:
        logger.exception('send_postmark raised:')
        raise e