ONSdigital / dp-data-pipelines

Pipeline specific python scripts and tooling for automated website data ingress.
MIT License
1 stars 0 forks source link

email notifications for invalid data submission #126

Closed Moasib-Arif closed 5 months ago

Moasib-Arif commented 5 months ago

What

Added the email client to send emails if files not found or distribution file not found and for data submission. Added feature flag the ability to turn the emails off Created email templates

How to review

Sanity check if the logic works and Check for any typos in utility.py, email_template_message.py and data_ingress_v1.py check if Emails are sent from the s3_tar_recieved pipeline if you have AWS access.

AWS Email setup In order to try this out you'll need to add the recipient email to ses and validate it (the usual confirmation url to an email address) - note, for the sender address I just created a free gmail email, you can do the same if you dont want to user a personal address, the setup steps once you have a recipient email are:

sign in to the bleed env
in the aws console go to simple email service
click "identities"
click email
add the email you want to receive the emails
go to the email you used and confirm the email address

set the env var TEMPORARY_SUBMITTER_EMAIL in glue.

go to aws in the bleed env
go to glue
go to the pipeline
look at the script tab - you can add temporary code there, you'll see the existing example,
In the script change the email on Line 17 to the above verifed email.

Upload the Tar file to the s3 bucket and you will recieve an email regarding data submission if any files are missing you will recieve a seperate email.

Who can review

Anyone with AWS Access