AERPAW-Platform-Control / aerpaw-portal

AERPAW Portal v2
0 stars 2 forks source link

AERPAW - request, message, email event triggers #28

Open mjstealey opened 2 years ago

mjstealey commented 2 years ago

AERPAW event triggers to create new request, message or email objects

User account

Account creation

message_subject = '[AERPAW] Welcome {0} to the AERPAW portal!'.format(user.display_name)
message_body = """
Hi {0},

Welcome to the AERPAW Portal

User manuals, tutorials, and other relevant documentation can be found at the following links; 
please refer to relevant instructions before attempting to use this Portal.

- AERPAW Main Site: https://aerpaw.org/
- AERPAW User Manual: https://sites.google.com/ncsu.edu/aerpaw-wiki/
- AERPAW Acceptable Use Policy: https://sites.google.com/ncsu.edu/aerpaw-wiki/aerpaw-user-manual/2-experiment-web-portal/2-5-acceptable-use-policy-aup

Thank you for joining AERPAW,
- AERPAW Ops
""".format(user.display_name)

Role requests

message_subject = '[AERPAW] Request for Experimenter role: {0}'.format(user_display_name)
message_body = """ 
Hi {0},

Your request to be granted the role of Experimenter has been forwarded to AERPAW Ops.
You will receive another email when your request has been addressed.
As noted in the AERPAW User Manual, this can take a variable amount of time, from minutes to hours.
""".format(user_display_name)
message_subject = '[AERPAW] re: Request for Experimenter role: {0}'.format(user_display_name)
message_body = """
Hi {0},

Your request to be granted the role of Experimenter has been {1}.

Note: {2}
""".format(user_display_name,
    'Approved' if str(user_request.get('is_approved')).casefold() in ['true'] else 'Denied',
    user_request.get('response_note'))
message_subject = '[AERPAW] Request for PI role: {0}'.format(user_display_name)
message_body = """
Hi {0},

Your request to be granted the role of Principal Investigator has been forwarded to AERPAW Ops.
You will receive another email when your request has been addressed.
As noted in the AERPAW User Manual, this can take a variable amount of time, from minutes to hours.
""".format(user_display_name)
message_subject = '[AERPAW] re: Request for PI role: {0}'.format(user_display_name)
message_body = """
Hi {0},

Your request to be granted the role of Principal Investigator has been {1}.

Note: {2}
""".format(user_display_name,
    'Approved' if str(user_request.get('is_approved')).casefold() in ['true'] else 'Denied',
    user_request.get('response_note'))

Project workflows

Membership

message_subject = '[AERPAW] {0} added to Project: {1} as {2}'.format(user_display_name, project.name, membership_type)
message_body = """
Hi {0},

You have been added to Project: {1} as {2}
""".format(user_display_name, project.name, membership_type)
message_subject = '[AERPAW] {0} removed from Project: {1} as {2}'.format(user_display_name, project.name, membership_type)
message_body = """
Hi {0},

You have been removed from Project: {1} as {2}
""".format(user_display_name, project.name, membership_type)
message_subject = '[AERPAW] Request to join Project: {0}'.format(project_name)
message_body = """
Hi {0},

Your request to join the Project: {1} has been forwarded to the owners of this project.
You will receive an email confirmation once one of the Project Owners has approved/denied this request.
""".format(user_display_name, project_name)
message_subject = '[AERPAW] re: Request to join Project: {0}'.format(project_name)
message_body = """
Hi {0},

Your request to join the Project: {1} has been {2}.

Note: {3}
""".format(user_display_name,
    project_name,
    'Approved' if str(user_request.get('is_approved')).casefold() in ['true'] else 'Denied',
    user_request.get('response_note'))

Experiment workflows

Membership

message_subject = '[AERPAW] {0} added to Experiment: {1} as Member'.format(user_display_name, experiment.name)
message_body = """
Hi {0},

You have been added to Experiment: {1} as Member
""".format(user_display_name, experiment.name)
message_subject = '[AERPAW] {0} removed from Experiment: {1} as Member'.format(user_display_name, experiment.name)
message_body = """
Hi {0},

You have been removed from Experiment: {1} as Member
""".format(user_display_name, experiment.name)
message_subject = '[AERPAW] Request to join Experiment: {0}'.format(experiment_name)
message_body = """
Hi {0},

Your request to join the Experiment: {1} has been forwarded to the members of this experiment.
You will receive an email confirmation once one of the Experiment Members has approved/denied this request.
""".format(user_display_name, experiment_name)
message_subject = '[AERPAW] re: Request to join Experiment: {0}'.format(experiment_name)
message_body = """
Hi {0},

Your request to join the Experiment: {1} has been {2}.

Note: {3}
""".format(user_display_name,
    experiment_name,
    'Approved' if str(user_request.get('is_approved')).casefold() in ['true'] else 'Denied',
    user_request.get('response_note'))

Development

# - notify: experiment_members
message_subject = '[AERPAW] Request to initiate development session for Experiment: {0}'.format(experiment.name)
message_body = """
Your request to initiate a development session for the experiment: {0} has been forwarded to AERPAW Ops.
When the Development Session is ready for you, you will receive another email with access info.
As noted in the AERPAW User Manual, this can take a variable amount of time, from minutes to hours.
""".format(experiment.name)
# - notify: experiment_members
message_subject = '[AERPAW] Development session for Experiment: {0} is active'.format(experiment.name)
message_body = """
Your development session for the experiment: {0} is ready for use.
""".format(experiment.name)
# - notify: experiment_members
message_subject = '[AERPAW] Saving development environment for Experiment: {0}'.format(experiment.name)
message_body = """
Saving experiment: {0}
As noted in the AERPAW User Manual, this can take a variable amount of time, from minutes to hours.
""".format(experiment.name)
# - notify: experiment_members
message_subject = '[AERPAW] Saving development environment for Experiment: {0}'.format(experiment.name)
        message_body = """
Saving experiment: {0}
As noted in the AERPAW User Manual, this can take a variable amount of time, from minutes to hours.
""".format(experiment.name)
# - notify: experiment_members, operators
message_subject = '[AERPAW] Development session for Experiment: {0} has been ended'.format(experiment.name)
message_body = """
Development session for Experiment: {0} has been ended and the experiment saved.
""".format(experiment.name)

Sandbox

Emulation

Testbed

# Submit to Testbed - button pressed by user - no emulation required
# - notify: experiment_members, operators
message_subject = '[AERPAW] Request to submit to testbed for Experiment: {0}'.format(experiment.name)
message_body = """
Your request to submit your experiment {0} for testbed execution has been forwarded to AERPAW Ops.
Your experiment may require Emulation prior to opportunistic scheduling and subsequent execution on the Testbed.

When the Testbed Execution is complete, you will receive another email. 
As noted in the AERPAW User Manual, this can take a variable amount of time, typically several days.

Experiment ID: {1}
Experiment UUID: {2}
""".format(experiment.name, str(experiment.id), str(experiment.uuid))
# Submit to Testbed - button pressed by user - emulation required
# - notify: experiment_members, operators
message_subject = '[AERPAW] Request to submit to testbed for Experiment: {0} (Emulation Required)'.format(experiment.name)
message_body = """
Your request to submit your experiment {0} for testbed execution has been forwarded to AERPAW Ops.
Your experiment requires Emulation prior to opportunistic scheduling and subsequent execution on the Testbed.

When the Testbed Execution is complete, you will receive another email. 
As noted in the AERPAW User Manual, this can take a variable amount of time, typically several days.

Experiment ID: {1}
Experiment UUID: {2}
""".format(experiment.name, str(experiment.id), str(experiment.uuid))
# Submit to Testbed - session is scheduled and awaiting execution on testbed
# - notify: experiment_members, operators
message_subject = '[AERPAW] Update for request to submit to testbed for Experiment: {0}'.format(experiment.name)
message_body = """
Your experiment {0} has been scheduled and is now awaiting execution on the Testbed.

When the Testbed Execution is complete, you will receive another email. 
As noted in the AERPAW User Manual, this can take a variable amount of time, typically several days.

Experiment ID: {1}
Experiment UUID: {2}
""".format(experiment.name, str(experiment.id), str(experiment.uuid))
# Submit to Testbed - session is being actively executed on the testbed
# - notify: experiment_members, operators
message_subject = '[AERPAW] Update - Experiment: {0} is now active on the testbed'.format(experiment.name)
message_body = """
Your experiment {0} is presently being executed on the Testbed.

When the Testbed Execution is complete, you will receive another email. 
As noted in the AERPAW User Manual, this can take a variable amount of time.

Experiment ID: {1}
Experiment UUID: {2}
""".format(experiment.name, str(experiment.id), str(experiment.uuid))
# Testbed execution cancelled - Testbed session has been cancelled
# - notify: experiment_members, operators
message_subject = '[AERPAW] Update - Experiment: {0} has been cancelled'.format(experiment.name)
message_body = """
Testbed execution for experiment {0} has been cancelled.

Experiment ID: {1}
Experiment UUID: {2}
""".format(experiment.name, str(experiment.id), str(experiment.uuid))
# Testbed execution completed - experiment has returned from testbed
# - notify: experiment_members, operators
message_subject = '[AERPAW] Update - Experiment: {0} has returned from testbed'.format(experiment.name)
message_body = """
Your experiment {0} has returned from testbed execution.

Experiment ID: {1}
Experiment UUID: {2}
""".format(experiment.name, str(experiment.id), str(experiment.uuid))