mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
Add service_email_reply_to DAO with an upsert method
This commit is contained in:
@@ -25,7 +25,9 @@ from app.models import (
|
||||
SMS_TYPE,
|
||||
INBOUND_SMS_TYPE,
|
||||
KEY_TYPE_NORMAL,
|
||||
ServiceInboundApi)
|
||||
ServiceInboundApi,
|
||||
ServiceEmailReplyTo
|
||||
)
|
||||
from app.dao.users_dao import save_model_user
|
||||
from app.dao.notifications_dao import dao_create_notification, dao_created_scheduled_notification
|
||||
from app.dao.templates_dao import dao_create_template
|
||||
@@ -327,3 +329,19 @@ def create_monthly_billing_entry(
|
||||
db.session.commit()
|
||||
|
||||
return entry
|
||||
|
||||
|
||||
def create_reply_to_email(
|
||||
service,
|
||||
email_address
|
||||
):
|
||||
data = {
|
||||
'service': service,
|
||||
'email_address': email_address,
|
||||
}
|
||||
reply_to = ServiceEmailReplyTo(**data)
|
||||
|
||||
db.session.add(reply_to)
|
||||
db.session.commit()
|
||||
|
||||
return reply_to
|
||||
|
||||
Reference in New Issue
Block a user