mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 23:55:58 -05:00
A small refactor to use the SMS_TYPE and EMAIL_TYPE in code rather that 'sms' or 'email'
This commit is contained in:
@@ -54,7 +54,7 @@ def send_sms_to_provider(self, service_id, notification_id, encrypted_notificati
|
||||
task_start = monotonic()
|
||||
|
||||
service = dao_fetch_service_by_id(service_id)
|
||||
provider = provider_to_use('sms', notification_id)
|
||||
provider = provider_to_use(SMS_TYPE, notification_id)
|
||||
notification = get_notification_by_id(notification_id)
|
||||
if notification.status == 'created':
|
||||
template = Template(
|
||||
|
||||
@@ -181,7 +181,7 @@ def send_email(service_id, notification_id, encrypted_notification, created_at,
|
||||
notification = encryption.decrypt(encrypted_notification)
|
||||
service = dao_fetch_service_by_id(service_id)
|
||||
|
||||
provider = provider_to_use('email', notification_id)
|
||||
provider = provider_to_use(EMAIL_TYPE, notification_id)
|
||||
|
||||
if not service_allowed_to_send_to(notification['to'], service):
|
||||
current_app.logger.info(
|
||||
@@ -204,7 +204,7 @@ def send_email(service_id, notification_id, encrypted_notification, created_at,
|
||||
sent_at=sent_at,
|
||||
sent_by=provider.get_name(),
|
||||
personalisation=notification.get('personalisation'),
|
||||
notification_type='email'
|
||||
notification_type=EMAIL_TYPE
|
||||
)
|
||||
|
||||
dao_create_notification(notification_db_object, EMAIL_TYPE)
|
||||
|
||||
Reference in New Issue
Block a user