mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 09:51:11 -05:00
Send broadcast invite email for broadcast service invites
This means the copy is more accurate and mentions sending emergency alerts rather than previous copy about sending emails texts and letters.
This commit is contained in:
@@ -11,7 +11,7 @@ from app.dao.invited_user_dao import (
|
||||
get_invited_users_for_service
|
||||
)
|
||||
from app.dao.templates_dao import dao_get_template_by_id
|
||||
from app.models import EMAIL_TYPE, KEY_TYPE_NORMAL, Service
|
||||
from app.models import BROADCAST_TYPE, EMAIL_TYPE, KEY_TYPE_NORMAL, Service
|
||||
from app.notifications.process_notifications import persist_notification, send_notification_to_queue
|
||||
from app.schemas import invited_user_schema
|
||||
from app.errors import register_errors
|
||||
@@ -27,7 +27,12 @@ def create_invited_user(service_id):
|
||||
invited_user, errors = invited_user_schema.load(request_json)
|
||||
save_invited_user(invited_user)
|
||||
|
||||
template = dao_get_template_by_id(current_app.config['INVITATION_EMAIL_TEMPLATE_ID'])
|
||||
if invited_user.service.has_permission(BROADCAST_TYPE):
|
||||
template_id = current_app.config['BROADCAST_INVITATION_EMAIL_TEMPLATE_ID']
|
||||
else:
|
||||
template_id = current_app.config['INVITATION_EMAIL_TEMPLATE_ID']
|
||||
|
||||
template = dao_get_template_by_id(template_id)
|
||||
service = Service.query.get(current_app.config['NOTIFY_SERVICE_ID'])
|
||||
|
||||
saved_notification = persist_notification(
|
||||
|
||||
Reference in New Issue
Block a user