Custom email notifications

isabel.a.p.almeida
isabel.a.p.almeida Member Posts: 4
edited September 2020 in Q&A

Good afternoon,

I am interested in using the custom email notifications from Domino, as shown here, https://docs.dominodatalab.com/en/3.6/reference/runs/Notifications.html. We need to create an email.html with the body of the email we want to have.

  1. Is there a way to not have the "email.html" attached to the email, since the content of this html files is already shown in the body of the email?
  2. Is there a way to have a condition that allows to only send emails, from schedule runs, if the conditions is met?


Thank you in advance,

Isabel

Comments

  • jake.diga
    jake.diga Member Posts: 7

    Hi Isabel,


    Thanks for sending these questions in. They are certainly interesting ones. So let's address them one by one:


    1. Is there a way to not have the "email.html" attached to the email, since the content of this html files is already shown in the body of the email?


    The email.html should not be included when you receive the email notifications. It will be placed in your projects root folder and will only serve as the body of your notification. But it would depend on your E-mail provider and app/software you are using. As an example Outlook shows certain files as attachment as well as in the body of the email. Are you getting the email.html as an attachment?

    2.Is there a way to have a condition that allows to only send emails, from schedule runs, if the conditions is met?


    We can set up notifications from schedule runs by going to the Scheduled Jobs section of your projects. From there you would be able to add the email address where you want the notification to go to. Just a heads up, we are still working on separating e-mail notifications for successful/failed schedule run so stay tuned :). 


    Let us know if you have other questions. 

  • katie.shakman
    katie.shakman Administrator, Domino Posts: 257 admin

    Hi @isabel.a.p.almeida ,

    If you want to further customize email sending, it's also possible to set up and send an email from within a run, for example using python packages like smtplib and email:

    Then you could include your conditions within your code and send an email only when those conditions are met.

    Katie

    Field Data Scientist @ Domino

  • isabel.a.p.almeida
    isabel.a.p.almeida Member Posts: 4

    Hi Jake,

    Thank you for answering so quickly.

    1. Indeed I am using Outlook. Here is an example of the email sent by Domino. The body looks as I want, but it also attachs the email.html.
    2. I am using the job scheduler, but once I set the email addresses to get notifications when the job finishs, these people will receive them in case the job is successful or fails, right? There is no way to discriminate, only send email if job is successful?

    Best regards,

    Isabel

  • isabel.a.p.almeida
    isabel.a.p.almeida Member Posts: 4

    Hi Katie,

    I haven't seen your answer when I was replying Jake. Great to know that this is possible, I will explore those packages!

    Thank you!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!