This is an example of a script to check and AGOL layer and specific information from it to specific people.
Specifically, the script is set to run on a schedule on a workstation/server. The script pulls the latest information from the AGOL layer and queries based on a specific field. Once the processing of the feature is complete, the field is updated to ensure it will not be processed again.
The email sends specific information via email to a set list of staff who process the data. It also sends a confirmation email to the submitter with a summary of their data.
Please modify to fit your needs If you have updates or improvements, I'd love to integrate them.