Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

send emails #232

Closed
prjemian opened this issue Sep 29, 2020 · 2 comments · Fixed by #236
Closed

send emails #232

prjemian opened this issue Sep 29, 2020 · 2 comments · Fixed by #236
Assignees
Labels
enhancement New feature or request

Comments

@prjemian
Copy link
Collaborator

One thing I was also thinking: is it possible to send out an email from Bluesky when a scan crashed or hung?

Originally posted by @qzhang234 in #230 (comment)

@prjemian prjemian self-assigned this Sep 29, 2020
@prjemian prjemian added the enhancement New feature or request label Sep 29, 2020
@prjemian
Copy link
Collaborator Author

Yes. See EmailNotifications(). (edited) This example is now in the docs:

from apstools.utils import EmailNotifications

SENDER_EMAIL = "8idiuser@aps.anl.gov"
email_notices = EmailNotifications(SENDER_EMAIL)
email_notices.add_addresses(
    "joe.user@anl.gov",
    "instrument_team@aps.anl.gov",
    # others?
)

# then, when some condition occurs
if feedback_limits_approached:
    subject = "Feedback problem"
    message = "Feedback is very close to its limits."
    email_notices.send(subject, message)

@qzhang234
Copy link
Collaborator

qzhang234 commented Oct 3, 2020

@prjemian This email function doesn't seem to be working (No email was sent during #233, for example)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants