mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Updated send_to_providers.py to use the notification email_reply_to address if there is one present otherwise it uses the service email_reply_to so now users can choose a per notification email_reply_to address.
This commit is contained in:
@@ -28,7 +28,7 @@ from app.models import (
|
||||
KEY_TYPE_NORMAL,
|
||||
ServiceInboundApi,
|
||||
ServiceEmailReplyTo,
|
||||
ServiceLetterContact, ServiceSmsSender)
|
||||
ServiceLetterContact, ServiceSmsSender, NotificationEmailReplyTo)
|
||||
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
|
||||
@@ -384,3 +384,21 @@ def create_letter_contact(
|
||||
db.session.commit()
|
||||
|
||||
return letter_content
|
||||
|
||||
|
||||
def create_reply_to_email_for_notification(
|
||||
notification_id,
|
||||
service,
|
||||
email_address,
|
||||
is_default=True
|
||||
):
|
||||
reply_to = create_reply_to_email(service, email_address, is_default)
|
||||
|
||||
notification_email_reply_to = NotificationEmailReplyTo(
|
||||
notification_id=str(notification_id),
|
||||
service_email_reply_to_id=str(reply_to.id)
|
||||
)
|
||||
db.session.add(notification_email_reply_to)
|
||||
db.session.commit()
|
||||
|
||||
return reply_to
|
||||
|
||||
Reference in New Issue
Block a user