mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 07:35:34 -05:00
Send Email via the API
- uses the new subject/email from fields present on the templates / service tables - brings the send email api call into line with the sms one. - same fields (to/template_id) - same rules regarding restricted services - wired in as a task into celery Requires - new celery queue - new env property (NOTIFY_EMAIL_DOMAIN)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
|
||||
import re
|
||||
from flask import request, url_for
|
||||
from flask import Flask, _request_ctx_stack
|
||||
from flask.ext.sqlalchemy import SQLAlchemy
|
||||
@@ -92,3 +92,10 @@ def get_db_version():
|
||||
return full_name.split('_')[0]
|
||||
except:
|
||||
return 'n/a'
|
||||
|
||||
|
||||
def email_safe(string):
|
||||
return "".join([
|
||||
character.lower() if character.isalnum() or character == "." else ""
|
||||
for character in re.sub("\s+", ".", string.strip())
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user