Background & Motivation
When an origin trial creation request is submitted, an email is sent to origin-trials-support@google.com (for non-automated requests) or if automated creation fails. Currently, the email populates the "Requested by" line using the ot_owner_email field, which corresponds to the "Google point of contact" on the form. However, the person submitting the form may not always be the point of contact. To properly track and communicate who is actually submitting the origin trial request, we need a separate field to capture the requester's email address and use this in the support notification emails.
Proposed Changes
-
Backend / Data Models (internals/core_models.py, internals/data_types.py):
- Add a new
StringProperty (e.g., ot_requester_email) to the Stage model to track the email of the user who requested the origin trial creation.
- Update
StageDict in internals/data_types.py to include ot_requester_email: str | None.
-
API & Handlers (api/api_specs.py, api/converters.py, framework/basehandlers.py):
- Add
ot_requester_email to STAGE_FIELD_DATA_TYPES in api/api_specs.py with type 'str'.
- Update
converters.stage_to_json_dict to include ot_requester_email.
- In
framework/basehandlers.py's update_stage method, when an origin trial action is requested (ot_action_requested is true), capture the current user's email (self.get_current_user().email()) and save it to the ot_requester_email field on the Stage entity.
-
OpenAPI Definitions (openapi/api.yaml):
- Add
ot_requester_email to the OpenAPI schema for StageField and CreateOriginTrialRequest, then regenerate the python and typescript models (via make openapi).
-
Email Templates & Notifiers (internals/notifier.py, templates/origintrials/):
- Update
internals/notifier.py make_creation_request_email to use stage['ot_requester_email'] (falling back to ot_owner_email if absent for backwards compatibility) for the "Requested by:" field instead of stage['ot_owner_email'].
- Update
templates/origintrials/ot-creation-request-failed-email.html to use ot_requester_email.
- Update tests in
internals/notifier_test.py to assert the correct requester email is used.
-
Frontend / Lit Components (client-src/js-src/cs-client.js):
- Update the frontend models (
cs-client.js) to recognize ot_requester_email.
- Update
admin/features/ot_requests.html to display the "Requester" utilizing ot_requester_email alongside the "Owner" (ot_owner_email).
Acceptance Criteria
This issue description was drafted by Gemini
Background & Motivation
When an origin trial creation request is submitted, an email is sent to
origin-trials-support@google.com(for non-automated requests) or if automated creation fails. Currently, the email populates the "Requested by" line using theot_owner_emailfield, which corresponds to the "Google point of contact" on the form. However, the person submitting the form may not always be the point of contact. To properly track and communicate who is actually submitting the origin trial request, we need a separate field to capture the requester's email address and use this in the support notification emails.Proposed Changes
Backend / Data Models (
internals/core_models.py,internals/data_types.py):StringProperty(e.g.,ot_requester_email) to theStagemodel to track the email of the user who requested the origin trial creation.StageDictininternals/data_types.pyto includeot_requester_email: str | None.API & Handlers (
api/api_specs.py,api/converters.py,framework/basehandlers.py):ot_requester_emailtoSTAGE_FIELD_DATA_TYPESinapi/api_specs.pywith type'str'.converters.stage_to_json_dictto includeot_requester_email.framework/basehandlers.py'supdate_stagemethod, when an origin trial action is requested (ot_action_requestedis true), capture the current user's email (self.get_current_user().email()) and save it to theot_requester_emailfield on theStageentity.OpenAPI Definitions (
openapi/api.yaml):ot_requester_emailto the OpenAPI schema forStageFieldandCreateOriginTrialRequest, then regenerate the python and typescript models (viamake openapi).Email Templates & Notifiers (
internals/notifier.py,templates/origintrials/):internals/notifier.pymake_creation_request_emailto usestage['ot_requester_email'](falling back toot_owner_emailif absent for backwards compatibility) for the "Requested by:" field instead ofstage['ot_owner_email'].templates/origintrials/ot-creation-request-failed-email.htmlto useot_requester_email.internals/notifier_test.pyto assert the correct requester email is used.Frontend / Lit Components (
client-src/js-src/cs-client.js):cs-client.js) to recognizeot_requester_email.admin/features/ot_requests.htmlto display the "Requester" utilizingot_requester_emailalongside the "Owner" (ot_owner_email).Acceptance Criteria
ot_requester_emailfield exists on theStagemodel.ot_requester_email.ot_requester_email.This issue description was drafted by Gemini