dmagic.message

Functions:

message(args)

Read the email template, inject the current Globus data link, and return an EmailMessage object ready to send.

send_email(args)

Send the experiment data-access email to all users on the DM experiment.

yes_or_no(question)

Prompt the user for a Y/N answer.

dmagic.message.html_to_text(html_content)[source]

Strip HTML tags and return a readable plain-text version.

dmagic.message.message(args)[source]

Read the email template, inject the current Globus data link, and return an EmailMessage object ready to send.

Supports two template formats: - HTML templates (file starts with ‘<html’): use %%DATA_LINK%% as placeholder;

sent as a multipart/alternative HTML email.

  • Plain-text templates: must contain a line starting with ‘Data link:’; sent as plain text.

dmagic.message.send_email(args)[source]

Send the experiment data-access email to all users on the DM experiment.

Prompts for Y (send to all), N (cancel), or T (test: secondary beamline contact only).

dmagic.message.yes_or_no(question)[source]

Prompt the user for a Y/N answer. Returns True for yes, False for no.