Update send_to_providers and create_dvla_file_contents_for_notifications to use notification.reply_to_text.

The next thing to do is to stop updating the notification to sender mapping tables.
This commit is contained in:
Rebecca Law
2017-11-27 15:24:16 +00:00
parent 4ecf168590
commit 03c3ebbbe7
5 changed files with 36 additions and 34 deletions

View File

@@ -402,7 +402,7 @@ def create_dvla_file_contents_for_notifications(notifications):
notification.template.__dict__,
notification.personalisation,
notification_reference=notification.reference,
contact_block=notification.service.get_default_letter_contact(),
contact_block=notification.reply_to_text,
org_id=notification.service.dvla_organisation.id,
))
for notification in notifications

View File

@@ -70,15 +70,11 @@ def send_sms_to_provider(notification):
raise
else:
try:
sms_sender = dao_get_notification_sms_sender_mapping(notification.id)
if not sms_sender:
sms_sender = service.get_default_sms_sender()
provider.send_sms(
to=validate_and_format_phone_number(notification.to, international=notification.international),
content=str(template),
reference=str(notification.id),
sender=sms_sender
sender=notification.reply_to_text
)
except Exception as e:
dao_toggle_sms_provider(provider.name)
@@ -129,10 +125,7 @@ def send_email_to_provider(notification):
from_address = '"{}" <{}@{}>'.format(service.name, service.email_from,
current_app.config['NOTIFY_EMAIL_DOMAIN'])
email_reply_to = dao_get_notification_email_reply_for_notification(notification.id)
if not email_reply_to:
email_reply_to = service.get_default_reply_to_email_address()
email_reply_to = notification.reply_to_text
reference = provider.send_email(
from_address,