Skip to content

Commit

Permalink
re-added notify_on
Browse files Browse the repository at this point in the history
  • Loading branch information
dbeltrankyl committed Dec 10, 2024
1 parent 2b33745 commit 38b7407
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion autosubmit/notifications/mail_notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ def notify_experiment_status(self, exp_id,mail_to,platform):
self._send_mail(self.config.MAIL_FROM, mail, message)
except BaseException as e:
Log.printlog('An error has occurred while sending a mail for warn about remote_platform', 6011)

def notify_status_change(self, exp_id, job_name, prev_status, status, mail_to):
message_text = self._generate_message_text(exp_id, job_name, prev_status, status)
message = MIMEText(message_text)
message['From'] = email.utils.formataddr(('Autosubmit', self.config.MAIL_FROM))
message['Subject'] = f'[Autosubmit] The job {job_name} status has changed to {str(status)}'
message['Date'] = email.utils.formatdate(localtime=True)
for mail in mail_to: # expects a list
for mail in mail_to: # expects a list
message['To'] = email.utils.formataddr((mail, mail))
try:
self._send_mail(self.config.MAIL_FROM, mail, message)
Expand Down

0 comments on commit 38b7407

Please sign in to comment.