mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-16 20:48:37 -04:00
Let the send_email task set the from address
This commit is contained in:
@@ -180,16 +180,10 @@ def process_job(job_id):
|
||||
)
|
||||
|
||||
if template.template_type == 'email':
|
||||
from_email = '"{}" <{}@{}>'.format(
|
||||
service.name,
|
||||
service.email_from,
|
||||
current_app.config['NOTIFY_EMAIL_DOMAIN']
|
||||
)
|
||||
|
||||
send_email.apply_async((
|
||||
str(job.service_id),
|
||||
create_uuid(),
|
||||
from_email.encode('ascii', 'ignore').decode('ascii'),
|
||||
'',
|
||||
encrypted,
|
||||
datetime.utcnow().strftime(DATETIME_FORMAT)),
|
||||
{'reply_to_addresses': service.reply_to_email_address},
|
||||
|
||||
@@ -167,13 +167,10 @@ def send_user_email_verification(user_id):
|
||||
'url': _create_verification_url(user_to_send_to, secret_code)
|
||||
}
|
||||
}
|
||||
email_from = '"GOV.UK Notify" <{}>'.format(
|
||||
current_app.config['VERIFY_CODE_FROM_EMAIL_ADDRESS']
|
||||
)
|
||||
send_email.apply_async((
|
||||
current_app.config['NOTIFY_SERVICE_ID'],
|
||||
str(uuid.uuid4()),
|
||||
email_from,
|
||||
'',
|
||||
encryption.encrypt(message),
|
||||
datetime.utcnow().strftime(DATETIME_FORMAT)
|
||||
), queue='email-registration-verification')
|
||||
|
||||
Reference in New Issue
Block a user