Our prayer team utilizes the prayer functions in Rock and they love it! However, because a person on the prayer team may not log in every day to begin a new prayer session, we wanted to have the option for Prayer Admins to quickly email our entire team when there is an urgent prayer request. Of course you can copy/paste or find another method to send out an email - but why not make it super simple? So with the use of a little bit of HTML/Lava and a Workflow, we made it as simple as 2 clicks right from the Prayer Request Detail page. If you're interested in learning how we did this, read on below!

Step 1: Add the workflow

This process is handled by a workflow, which you can download in this recipe. So let's get that setup first.

  1. Download the Workflow and upload it to your Rock Instance.
  2. Edit the workflow. Expand the Workflow Attributes and Edit the Prayer Team Attribute. This is the group of people who will receive the Urgent Emails. We used a Security Role for this and selected the role RSR - Prayer Access, so if you also use that for all your prayer team members, select this Security Role. (If you would rather use a group instead of a Security Role, just delete this attribute and add a Group attribute with the Group you want the emails to be sent to.)
  3. Head on down to the Workflow Activity Communication and expand the Send Email Action. If you opted to use a Group instead of a Security Role, make sure to change the To Attribute of this Action to your group.
  4. In the Email body, you will see the following HTML. You will want to change this to link to wherever you have your prayer team login to start a prayer session. For us, Prayer Team members begin a prayer session from their My Account page - hence the link you see below.
<a href="{{ 'Global' | Attribute:'PublicApplicationRoot' }}">click here</a>

Step 2: Add a page

We now need to add a page that will display the Workflow, giving a confirmation to the user before sending, "Are you sure...?"

  1. Head over to the Prayer Page and then the Prayer Requests page. You should be looking at your list of Prayer Requests. Hovering over the bottom of the page, click "Child Pages" and then click the + sign to add a child page. I called this new page "Email Urgent Request". Choose a Full Width layout and keep all the standard page settings.
  2. Edit the Main Zone and then add a Workflow Entry Block to the page.
  3. Edit the Workflow Entry Block, and add your Email Urgent Request Workflow. Set the Block Title Template to "Urgent Request". 
  4. Your page may be displaying some errors at this point. Don't worry, thats ok. It should now look something like this:


Step 3: Add the Magic Button

Now we need to add a button on the Prayer Request Detail page that links to the page we just added in the last step.

  1. Navigate to the Prayer Request Detail page by going to your Prayer Request List and selecting one of the requests. Find a spot on the page to add a new block that works for your organization - for us this was in the Main Zone, in between the Prayer Request Detail and Prayer Comments Blocks. Once you've decided, go ahead and add an HTML Block.
  2. Edit the HTML Block and drop in the following HTML. You will just need to change the Page Id (ours was 909) to the Page Id of your new page you created in Step 2.
{% assign prayerId = 'Global' | PageParameter:'PrayerRequestId' %}
<div class="panel panel-default">
    <div class="panel-heading">
        <h1 class="panel-title"><i class="fa fa-exclamation-circle"></i> Urgent Request</h1>
    <div class="panel-body">
        <p>If this request is urgent, click the button below to email it to the prayer team.</p>
        <a href="~/page/909?PrayerRequestId={{ prayerId }}" class="btn btn-primary">Email Urgent Request</a>

You should now have a stunning looking block on the page that looks something like this:


Now, when you click the Email Urgent Request button, your newly created page from step 2 should look like this:


Step 4: Celebrate!

Test it out! One recommendation however - in the Workflow, change who the Communication is sent to - for example, test sending it to just yourself at first and not your whole prayer team.