Atlas-Assistance-Dogs / atlas-dogs

Repository for Atlas Dogs flows in Salesforce
1 stars 1 forks source link

Datamodel support to Automate emailing log reminders to clients and facilitators when client is in training #546

Open atlasjen opened 1 month ago

atlasjen commented 1 month ago

We have the use case of wanting to be able to schedule emails for all in-training teams to remind both the client and facilitator to log their status reports. Clients log weekly. Facilitators log every other week.

Maria was looking into how to do this with flows and hit the issue

ideally the emails have some salesforce fields that make it obvious who they apply to.. so some derived fields. so for facilitator, it would say they need to file their log for client X. or Team X and the URL would be derived. for client, it would say they need to file their log for Team X and same deal, the URL would be derived.

ideas? Maria said one way to trigger it was for there to be a boolean like "TeamLogReminder" or "ClientLogReminder" This would be set based on Team/Client status changing state to or from InTraining.

What is trickier, is we'd want to do the same for the Facilitator .. so if a client is in training, we go to relationships and look for the faciliator relationship and then that is who we active the FacilitatorLogReminder for.. but the checkbox alone here doesn't give us the info on which team it is for.. and some TFs have more than one client.

if there was a way to access the facilitator in the Team, that could work, but since everything pushes down from team to contact, i worry about something populating in reverse.

Debbie, thoughts?

deb761 commented 1 month ago

I think setting up a scheduled Apex job would do it. In Apex, we can do the queries to find the facilitator for each Team.

atlasjen commented 1 month ago

ok. then let's do it that way. Here is what i want to do

triggered by changing team status to INTRAINING or scheduled to just run a specific day of the week.

Dear <preferred name>, We hope your week is going wonderfully.

If you have recently submitted your training logs for <team name>, then thank you! If not, please remember to submit your training logs for all clients you are working with at least every two weeks. The URL below is specific to this team and is pre-populated with their info. These logs are critical to track progress and to maintain compliance with the organizations we seek accreditation with.

Simply go here to submit your logs for team:<team name>: [NOTE to Debbie: the actual URL is different than the display URL. { } surround salesforce fields] <a href="https://atlasdog.tfaforms.net/4819325?tfa_3={client first and last name}&tfa_67={dog name}&tf_22={tf first and lastname}&tfa_68={team name}">https://atlasdog.tfaforms.net/4819325</a>

Thank you for making such a difference in people's lives!

Atlas Assistance Dogs info@atlasdog.org


email the Client this message: subject "Please remember to submit your client training logs for your team: <team name>"

Dear <preferred name>, We hope your week is going wonderfully.

If you have recently submitted your client log for your team, <team name>, then thank you! If not, please remember to submit your logs each week. The URL below is specific to your team and has data is pre-populated for you. These logs are critical to track progress, make sure we are supporting you properly, and to maintain compliance with the organizations we seek accreditation with.

Simply go here to submit your logs: [NOTE to Debbie: the actual URL is different than the display URL. { } surround salesforce fields] <a href="https://atlasdog.tfaforms.net/4821671?tfa_3={client first and last name}&tfa_7={dog name}&tfa_56={team name}">https://atlasdog.tfaforms.net/4821671</a>

Thank you for being a part of Atlas.

Atlas Assistance Dogs info@atlasdog.org

deb761 commented 3 days ago

Here's my thoughts:

  1. Reminder emails will go out on whatever day of the week you schedule the job to run.
  2. Client emails will go out if there isn't a log within the last 7 days, and the Training start date is at least 3? days ago.
  3. Team facilitator emails will go out if there isn't a log within the last 14 days, and the Training start date is at least 10? days ago.
  4. Team facilitator is defined at the team, rather than searching relationships.
atlasjen commented 3 days ago

re #4, presently multiple facilitators could be related w a team.

My other thought there is a report i like to run looks at which facilitators are associated w/ clients and how many. so if we are moving the relationship onto the team, i want to make sure i can still accomplish that. i would think i could. it would just tie to the team vs the contact. https://atlasassistancedogs.lightning.force.com/lightning/r/Report/00ORg000000KLTJMA4/view?queryScope=userFolders

1-3 sound perfect. I also realized (doh) that i added a hidden field of team name to the form in form assembly so we should add that to the URLs. i need to look up the syntax for which field ID it is in form assembly.