def send_test_mail(): message = Message( body="It worked!", subject="Shabus Test Email", sender=os.environ["MAIL_SENDER"], recipients=[raw_input("Recipient email address: ")]) mail.send(message)
def send_error_email(error, submission_id): submission_link = jotform.JOTFORM_SUBMISSION_LINK % submission_id body = "Error while processing jotform submission with id %s.\nSubmittion details: %s\n\n%s" % ( submission_id, submission_link, error) msg = Message( body=body, subject="Shabus JotForm Webhook Error", sender=os.environ["MAIL_SENDER"], recipients=os.environ["WEBHOOK_ERROR_RECIPIENTS"].split(";")) mail.send(msg)