I have a Python script that calls an API to fetch information about the job runs we have on IDMC from Informatica. The data queried from the API contains the runID
, runName
, Status
and dates.
I want to have a framework where I can get notified via email in case of a job failure (Status
= ‘Failed’ or ‘Suspended’).
Unfortunately, it’s not possible, due to internal issues, to set an email notification from IDMC directly in case of a job failure, hence, I developed this Python query.
How can I do that? Given that we have a pipeline on Azure DevOps that runs the script on a daily schedule.
Any help would be much appreciated!
use pip install yagmail
:
example:
import yagmail
yag = yagmail.SMTP(user="[email protected]",
password="your_email_password")
yag.send("[email protected]", "Subject", "Hello, this is a test
email from Python.")
the code is pretty self explaintory but If you have any questions let me know
gaskutiy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
4