Update 4/1/2023 - It was brought to my attention that some of my code was stripped out, so much of this was unusable. I am sorry for any frustration that may have caused. I have updated this recipe with GitHub Links to prevent that from happening.

Why

When our organization wanted to move all our volunteer scheduling from PCO to Rock, we knew it would be vital to give ministry Pastors the ability to customize emails. These emails would be for their ministry at their campus before sending out their group scheduling notifications. 

Giving ministry Pastors the ability to customize their emails gives each of them a voice in their emails instead of just a canned response. It also lets them inform their volunteers about exciting news, training videos, or what to expect this weekend without needing to reach out to anyone with administrative rights to change and update the email content.

Implementation

Our implementation of customizable emails takes advantage of merging in a content channel item, the ministry, and the campus through a couple of Lava Shortcodes. The parent Shortcode is present in a System Communication that is sent through the Core Rock means of Group Scheduling. We then give the ministry Pastors a comfortable interface to search for, adding, editing, and deleting emails. This interface also empowers the Pastors to see which email is live and sent upon scheduling their volunteers.

To keep this recipe relatively short, I stripped most of the styling out of the code I am sharing.

Step #1 - Add Content Channel Type 

  1. Add new content channel type with the settings below
    NewContentType2.png
  2. Add Campus Attribute that is Active, Show in Grid, and the Filter Campus Types and Status that is appropriate for your organization.ContentTypeCampus3.png

Step #2 - Add Content Channel

  • You will want to add a new Content Channel for each ministry you plan on using group scheduling for. Here are the settings we use:NewContentChannel_2.png

Step #3 - Add Default Content Channel Item

  • Adding a default item in the Content Channel you created in Step #2 is a must so that if a Pastor doesn't add one themselves, this system will have a fallback email.

Step #4 - Add Group Scheduling Active Item Lava Shortcode

  1. Add a new Lava Shortcode with these settings:
    GroupSchedlingActiveItemTop_3.png
  2. Add this code to the Shortcode Markup:
  3. Active Item Code GitHub
  4.  Add the following Parameters and Enable the Sql Lava Command:
    GroupSchedlingActiveItemBottom_2.png

Step #5 - Add Group Scheduling Confirmation Email Content Lava Shortcode

  1. Add a new Lava Shortcode with these settings:
    GroupScheduling_ConfirmationEmail_ContentTop.png
  2. Add this code to the Shortcode Markup:
  3. Confirmation Email Code GitHub
  4.  Add the following Parameters and Enable the Cache, RockEntity, & WorkflowActivate Lava Command:
    GroupScheduling_ConfirmationEmail_ContentBottom.png

Step #6 - Add New System Communication

  1.  Add a new system communication with the following settings
    SystemCommunication.png
  2. If you click the preview button you will see that your scheduling email is set up. 

Step #7 - Add a Group Scheduling Page

  1. Your next step is to create a page for your ministry leaders to view and edit the templates they want. For the sake of simplicity I put this under the intranet, but feel free to place this wherever makes sense for your organization.
    GroupSchedulingPage.png
  2. Set up security rules for this page that makes sense for your organization.  When setting the security permissions for this page, remember that its intended for ministry leaders to view.
  3. Now that we have a beautiful blank group scheduling page, we are going to create a child page of that called "Schedule Confirmation Email Edit" as seen in the next screenshot:
    EmailEdit.png
  4. With this newly created page, you'll probably just want to inherit the same security from its parent.
  5. On the "Schedule Confirmation Email Edit" page you really only need one page block and that is a Content Item Detail with the following settings:
    ContentItemDetail.png
  6. Navigating back to the "Group Scheduling Emails" page, you will need 3 different page blocks. The first page block that I placed in SectionE of that page is a "Page Parameter Filter" block with these settings:
    Filter.png
  7. In that filters block, you will need 3 different attributes those attributes need the following settings:
    FilterTitleAttribute.png
    FilterDateAttribute.png
    FilterCampus.png
  8. The last block you'll need on SectionE is a Dynamic Data block with these settings:
    DynamicData2.png
  9. Parameters:
  10. ActiveOnDate=,Title=

  11. Query:
  12. Query Code GitHub
  13. Hidden Columns:
  14. Id,TitleFilter,ActiveOnDateFilter,CurrentPageRoute,CampusGuid,ParamCampus

  15. Selection Url:
  16. {CurrentPageRoute}?ItemId={Id}&Title={TitleFilter}&ActiveOnDate={ActiveOnDateFilter}&CampusGuid={CampusGuid}

  17. In the Dynamic Data Block's Advanced Settings Add the folling code to the Pre-HTML:
  18. Dynamic Data Block Pre-HTML Code GitHub
  19. In the Dynamic Data Block's Advanced Settings Add the folling code to the Post-HTML:
  20. Dynamic Data Block Post-HTML Code GitHub
  21. The last block you'll need is a HTML Content block in the SectionF zone. In the HTML Content Block Settings you will want to make sure that RockEntity is checked as seen in this screenshot:
    HTMLSettings.png
  22. In the HTML Content you will need to add the following code:
  23. HTML Content Code GitHub

Step #8 - Group Scheduling Config

  1. The last thing you need to do is setup group scheduling according to the Rock Documentation and link the confirmation emails to the appropriate System Email(s) you setup during this recipe.

Follow Up

Please don't hesitate to leave a comment below or hit me up on Rock Chat (@gordo) if you have questions or find any issues with this recipe.