PURPOSE

We use Southeast's Pastoral Care plugin to manage our hospitalizations, nursing home residents, and homebound attendees. We have a hospital team that volunteers on rotation to visit those people, and our staff also need the list to be praying over them and visiting them. We wanted the hospital team to have easy and direct access to the resident / hospitalized individual so they could add their own visitation notes. This saves so much time for the person on our staff that used to manually compile the data, send the daily email, and update everyone's notes. The Nursing Home and Hospital sections of the email include the hospital or nursing home the person is at, and the homebound section includes the address of the homebound person to make it easy for people to have what they need in the email itself.


REQUIREMENTS

I'm gonna walk through what we did and the access that we gave, but know this is totally flexible for your own needs at your own church.

  • Establish the group(s) that need to receive this email
    • We have four groups/people that receive this email: hospital team, staff, our receptionist, and elders.
  • Ensure your process utilizes the discharge and end dates when people are no longer homebound / hospitalized / or in a nursing home
  • This one is obvious, but, you need to have the Pastoral Care plugin installed (free, from Southeast Christian Church)
  • Setup each recipient profile that needs to update the notes on their own to have a login and be a part of the RSR - Staff Like Workers role (or whatever other security level you use for non-staff, you can roll your own if you'd like)
    • We didn't distribute usernames and passwords to these individuals, we rely solely on the links in the emails for them to gain access. The primary visitation team consists of some older folks that aren't as accustomed to technology, so we tried to make this process as simple as possible for them.


SETUP

There's two parts to the setup: setting up the workflow that does the actual sending of the email(s), and the job administration to run the workflow at a specific time each day.

SETTING UP THE WORKFLOW

1. Create a new workflow in the Pastoral Care workflow category under General Settings > Workflow Configuration

Screen Shot 2020-01-15 at 10.54.24 AM.png





Screen Shot 2020-01-15 at 10.55.43 AM.png


2. Create your workflow attributes

You need, at minimum, two attributes. One to establish the "from" address and one to establish the "to" group of people. For every additional recipient group, create another group attribute. Make sure to configure the default value of each recipient group attribute to be the group you want to receive the email.

Screen Shot 2020-01-15 at 10.59.31 AM.png


3. Create your workflow actions

You'll need at least two actions: one for sending the email to a group and one for completing the workflow. You'll need an additional action for each other group (or individual not in a group) you want the email to be sent to. For example, we have 5 actions: sending the email to our staff group, sending the email to our elder group, sending the email to our hospital volunteer group, sending the email to our receptionist, and completing the workflow.

The email code used in each action for each recipient group is identical except for the auto-login links. Staff recipients are not auto-logged in (they know how to login, and if they forward an email on, they are basically handing over their Rock access, so we don't auto log them in), however the hospital volunteers and the elders are auto-logged in.

Here's an example of the send email action that goes to staff (email code will be at the end):

Screen Shot 2020-01-15 at 11.11.16 AM.png

Create as many "Email Send" actions as you need, one per group or non-group recipient. Just remember, if you're sending this to someone and expect them to auto-login, you have to send to a group or person profile, not just an email address. 

The very last action you'll create is a "Workflow Complete" action:

Screen Shot 2020-01-15 at 11.14.15 AM.png


SETTING UP THE JOB
  1. Go to Rock Settings > System Settings, then click Jobs Administration
  2. Create a new job and configure it as follows:
    1. Name: Send Nursing Home/POC Email
    2. Description: Runs a workflow that generates the list of current people hospitalized or at a nursing home.
    3. Cron Expression: 0 0 7 ? * MON-FRI *
      1. This will send at 7a every weekday. If you'd like to adjust how often it sends and what time of day, customize the cron expression. Check out CronMaker.com if you need help with it!
    4. Job Type: Rock.Jobs.LaunchWorkflow
    5. Workflow: Select the workflow you previously created
    6. Screen Shot 2020-01-15 at 11.18.16 AM.png
  3. Hit Save, and you're done!



EMAIL CODE / CAVEATS

There's two versions of the email code, one includes the auto-login code on the links, one does not. Otherwise, they are identical. The other thing to pay attention to is the IDs of the Pastoral Care workflows and activities. Here's what they are on our Rock instance, if these are the same in your system, you don't have to change the email code at all. However, if they do differ, be sure to update the email code to reflect what ID's your system has for those workflows and activities. You can find the workflow IDs by clicking on the workflow in the list on the workflow configuration page and looking at the right of the name. The activity IDs are listed when you click "Edit" on the workflow itself (see screenshot below).

Screen Shot 2020-01-15 at 11.25.28 AM.png

Screen Shot 2020-01-15 at 11.46.24 AM.png

  • Homebound Resident Workflow ID: 60
  • Nursing Home Resident Workflow ID: 61
  • Hospital Admission Workflow ID: 62
  • Homebound Resident Visitation Info ActivityType ID: 213
  • Nursing Home Resident Visitation Info ActivityType ID: 217
  • Hospital Admission Visitation Info ActivityType ID: 220

There are six entity commands in the email that use the corresponding workflow and activity IDs. If your workflow or activity IDs are different than what's above, you'll only need to change each ID in one spot, six total. The lines you'd look to change look like this for the workflow IDs:

{% workflow where:'WorkflowTypeId == 62' %}

and this for the activity IDs:

{% workflowactivity where:'ActivityTypeId == 220 && WorkflowId == "{{ hosp.Id }}"' %}

At the bottom of the email there is a button linking to our hospital and POC calendar rotation on Google calendar (google.com in the provided code). If you don't need that functionality, just remove the button!


Email code without auto-login capability:

<!-- THIS EMAIL WAS BUILT AND TESTED WITH LITMUS http://litmus.com -->
<!-- IT WAS RELEASED UNDER THE MIT LICENSE https://opensource.org/licenses/MIT -->
<!-- QUESTIONS? TWEET US @LITMUSAPP -->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
/* CLIENT-SPECIFIC STYLES */
body, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
img { -ms-interpolation-mode: bicubic; }
/* RESET STYLES */
img { border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }
table { border-collapse: collapse !important; }
body { height: 100% !important; margin: 0 !important; padding: 0 !important; width: 100% !important; }
/* iOS BLUE LINKS */
a[x-apple-data-detectors] {
    color: inherit !important;
    text-decoration: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
}
/* MEDIA QUERIES */
@media screen and (max-width: 480px) {
    .mobile-hide {
        display: none !important;
    }
    .mobile-center {
        text-align: center !important;
    }
}
/* ANDROID CENTER FIX */
div[style*="margin: 16px 0;"] { margin: 0 !important; }
</style>
<body style="margin: 0 !important; padding: 0 !important; background-color: #eeeeee;" bgcolor="#eeeeee">
<!-- HIDDEN PREHEADER TEXT -->
<div style="display: none; font-size: 1px; color: #fefefe; line-height: 1px; font-family: Open Sans, Helvetica, Arial, sans-serif; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden;">
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td align="center" style="background-color: #eeeeee;" bgcolor="#eeeeee">
        <!--[if (gte mso 9)|(IE)]>
        <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
        <tr>
        <td align="center" valign="top" width="600">
        <![endif]-->
        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
            <tr>
                <td align="center" valign="top" style="font-size:0; padding: 35px;" bgcolor="#0076C0">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="left" valign="top" width="300">
                <![endif]-->
                <div style="display:inline-block; max-width:70%; min-width:100px; vertical-align:top; width:100%;">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:300px;">
                        <tr>
                            <td align="left" valign="top" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 36px; font-weight: 800; line-height: 48px;" class="mobile-center">
                                <h1 style="font-size: 30px; font-weight: 800; margin: 0; color: #ffffff; text-align:center;">Hospitals</h1>
                            </td>
                        </tr>
                    </table>
                </div>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                <td align="right" width="300">
                <![endif]-->
                
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" style="padding: 5px 35px 20px 35px; background-color: #ffffff;" bgcolor="#ffffff">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="center" valign="top" width="600">
                <![endif]-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
                    <tr>
                        <td align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding-top: 10px;">
                            <p style="font-size: 16px; font-weight: 400; line-height: 24px; color: #777777;">
                                To add any notes or discharge a person, simply tap their name, and you'll be taken to the database to update their information.
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" style="padding-top: 20px;">
                            <table cellspacing="0" cellpadding="0" border="0" width="100%">
                              {% workflow where:'WorkflowTypeId == 62' %}
                                  {% assign activeHosp = workflowItems | SortByAttribute:'Hospital' %}
                                  {% for hosp in activeHosp %}
                                    {% assign discharge = hosp | Attribute:'DischargeDate' %}
                                    {% if discharge == "" %}
                                      {% capture updateLink %}{{ 'Global' | Attribute:'InternalApplicationRoot' }}Pastoral/Hospitalization/{{ hosp.Id }}{% endcapture %}
                                      {% assign person = hosp | Attribute:'PersonToVisit','Object' %}                                    
                                        <tr>
                                            <td width="75%" align="left" bgcolor="#eeeeee" colspan="2" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 24px; padding: 10px;">
                                                <a href="{{ updateLink }}" style="color:#0076c0;">{{ person.FullName }} - {{ hosp | Attribute:'Hospital' }}</a>
                                            </td>                                    
                                        </tr>
                                        <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   <i>Admission Notes</I>
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  <i>{{ hosp | Attribute:'AdmitDate' }}: {{ hosp | Attribute:'VisitationRequestDescription' }}</I>
                                              </td>
                                          </tr>
                                      {% workflowactivity where:'ActivityTypeId == 220 && WorkflowId == "{{ hosp.Id }}"' %}
                                          {% assign sortedActivities = workflowactivityItems | SortByAttribute:'VisitDate','desc' %}
                                          {% for activity in sortedActivities limit:1 %}
                                          <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   {{ activity | Attribute:'VisitDate' }}
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  {{ activity | Attribute:'VisitNote' }}
                                              </td>
                                          </tr>
                                          {% endfor %}
                                      {% endworkflowactivity %}
                                    {% endif %}
                                {% endfor %}
                            {% endworkflow %}                              
                            </table>
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" valign="top" style="font-size:0; padding: 35px;" bgcolor="#0076C0">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="left" valign="top" width="300">
                <![endif]-->
                <div style="display:inline-block; max-width:70%; min-width:100px; vertical-align:top; width:100%;">
                    <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:500px;">
                        <tr>
                            <td align="left" valign="top" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 36px; font-weight: 800; line-height: 48px;" class="mobile-center">
                                <h1 style="font-size: 30px; font-weight: 800; margin: 0; color: #ffffff; text-align:center;">Nursing Home / Rehab</h1>
                            </td>
                        </tr>
                    </table>
                </div>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                <td align="right" width="300">
                <![endif]-->
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" style="padding: 5px 35px 20px 35px; background-color: #ffffff;" bgcolor="#ffffff">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="center" valign="top" width="600">
                <![endif]-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
                    <tr>
                        <td align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding-top: 10px;">
                            <p style="font-size: 16px; font-weight: 400; line-height: 24px; color: #777777;">
                                To add any notes or discharge a person, simply tap their name, and you'll be taken to the database to update their information.
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" style="padding-top: 20px;">
                            <table cellspacing="0" cellpadding="0" border="0" width="100%">
                              {% workflow where:'WorkflowTypeId == 61' %}
                                  {% assign activeHosp = workflowItems | SortByAttribute:'NursingHome' %}
                                  {% for hosp in activeHosp %}
                                    {% assign discharge = hosp | Attribute:'DischargeDate' %}
                                    {% if discharge == "" %}
                                      {% capture updateLink %}{{ 'Global' | Attribute:'InternalApplicationRoot' }}Pastoral/NursingHome/{{ hosp.Id }}{% endcapture %}
                                      {% assign person = hosp | Attribute:'PersonToVisit','Object' %}
                                      <tr>
                                          <td width="75%" align="left" bgcolor="#eeeeee" colspan="2" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 24px; padding: 10px;">
                                              <a href="{{ updateLink }}" style="color:#0076c0;">{{ person.FullName }} - {{ hosp | Attribute:'NursingHome' }}</a>
                                          </td>                                    
                                      </tr>
                                      <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   <i>Admission Notes</I>
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  <i>{{ hosp | Attribute:'AdmitDate' }}: {{ hosp | Attribute:'VisitationRequestDescription' }}</I>
                                              </td>
                                          </tr>
                                      {% workflowactivity where:'ActivityTypeId == 217 && WorkflowId == "{{ hosp.Id }}"' %}
                                          {% assign sortedActivities = workflowactivityItems | SortByAttribute:'VisitDate','desc' %}
                                          {% for activity in sortedActivities limit:1 %}
                                          <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   {{ activity | Attribute:'VisitDate' }}
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  {{ activity | Attribute:'VisitNote' }}
                                              </td>
                                          </tr> 
                                          {% endfor %}
                                      {% endworkflowactivity %}
                                     {% endif %}
                                  {% endfor %}
                              {% endworkflow %}                             
                            </table>
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            
            <tr>
                <td align="center" valign="top" style="font-size:0; padding: 35px;" bgcolor="#0076C0">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="left" valign="top" width="300">
                <![endif]-->
                <div style="display:inline-block; max-width:70%; min-width:100px; vertical-align:top; width:100%;">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:300px;">
                        <tr>
                            <td align="left" valign="top" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 36px; font-weight: 800; line-height: 48px;" class="mobile-center">
                                <h1 style="font-size: 30px; font-weight: 800; margin: 0; color: #ffffff; text-align:center;">Homebound</h1>
                            </td>
                        </tr>
                    </table>
                </div>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                <td align="right" width="300">
                <![endif]-->
                
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" style="padding: 5px 35px 20px 35px; background-color: #ffffff;" bgcolor="#ffffff">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="center" valign="top" width="600">
                <![endif]-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
                    <tr>
                        <td align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding-top: 10px;">
                            <p style="font-size: 16px; font-weight: 400; line-height: 24px; color: #777777;">
                                To add any notes or discharge a person, simply tap their name, and you'll be taken to the database to update their information.
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" style="padding-top: 20px;">
                            <table cellspacing="0" cellpadding="0" border="0" width="100%">
                              {% workflow where:'WorkflowTypeId == 60' %}
                                  {% assign activeHome = workflowItems %}
                                  {% for home in activeHome %}
                                    {% assign end = home | Attribute:'EndDate' %}
                                    {% if end == "" %}
                                      {% capture updateLink %}{{ 'Global' | Attribute:'InternalApplicationRoot' }}Pastoral/Homebound/{{ home.Id }}{% endcapture %}
                                      {% assign person = home | Attribute:'HomeboundPerson','Object' %}                                    
                                        <tr>
                                            <td width="75%" align="left" bgcolor="#eeeeee" colspan="2" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 24px; padding: 10px;">
                                                <a href="{{ updateLink }}" style="color:#0076c0;">{{ person.FullName }}</a> - <a href="https://maps.google.com/maps?q={{ person | Address:'Home' }}">{{ person | Address:'Home'}}</a>
                                            </td>                                    
                                        </tr>
                                        <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   <i>Admission Notes</I>
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  <i>{{ home | Attribute:'StartDate' }}: {{ home | Attribute:'HomeboundResidentDescription' }}</I>
                                              </td>
                                          </tr>
                                      {% workflowactivity where:'ActivityTypeId == 213 && WorkflowId == "{{ home.Id }}"' %}
                                          {% assign sortedActivities = workflowactivityItems | SortByAttribute:'VisitDate','desc' %}
                                          {% for activity in sortedActivities limit:2 %}
                                          <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   {{ activity | Attribute:'VisitDate' }}
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  {{ activity | Attribute:'VisitNote' }}
                                              </td>
                                          </tr>
                                          {% endfor %}
                                      {% endworkflowactivity %}
                                    {% endif %}
                                {% endfor %}
                            {% endworkflow %}                              
                            </table>
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" style=" padding: 35px; background-color: #ffffff;" bgcolor="#1b9ba3">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="center" valign="top" width="600">
                <![endif]-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
                    <tr>
                        <td align="center" style="padding: 25px 0 15px 0;">
                            <table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td align="center" style="border-radius: 5px;" bgcolor="#66b3b7">
                                      <a href="https://google.com" target="_blank" style="font-size: 18px; font-family: Open Sans, Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; border-radius: 5px; background-color: #0076c0; padding: 15px 30px; border: 1px solid #0076c0; display: block;">POC / Hospital Calendar</a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
        </table>
        <!--[if (gte mso 9)|(IE)]>
        </td>
        </tr>
        </table>
        <![endif]-->
        </td>
    </tr>
</table>
    
</body>
</html>


Email code with auto-login capability (changed by adding the ?{{ Person.ImpersonationParameter }} code at the end of each URL)

<!-- THIS EMAIL WAS BUILT AND TESTED WITH LITMUS http://litmus.com -->
<!-- IT WAS RELEASED UNDER THE MIT LICENSE https://opensource.org/licenses/MIT -->
<!-- QUESTIONS? TWEET US @LITMUSAPP -->
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<style type="text/css">
/* CLIENT-SPECIFIC STYLES */
body, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; }
table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; }
img { -ms-interpolation-mode: bicubic; }
/* RESET STYLES */
img { border: 0; height: auto; line-height: 100%; outline: none; text-decoration: none; }
table { border-collapse: collapse !important; }
body { height: 100% !important; margin: 0 !important; padding: 0 !important; width: 100% !important; }
/* iOS BLUE LINKS */
a[x-apple-data-detectors] {
    color: inherit !important;
    text-decoration: none !important;
    font-size: inherit !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
}
/* MEDIA QUERIES */
@media screen and (max-width: 480px) {
    .mobile-hide {
        display: none !important;
    }
    .mobile-center {
        text-align: center !important;
    }
}
/* ANDROID CENTER FIX */
div[style*="margin: 16px 0;"] { margin: 0 !important; }
</style>
<body style="margin: 0 !important; padding: 0 !important; background-color: #eeeeee;" bgcolor="#eeeeee">
<!-- HIDDEN PREHEADER TEXT -->
<div style="display: none; font-size: 1px; color: #fefefe; line-height: 1px; font-family: Open Sans, Helvetica, Arial, sans-serif; max-height: 0px; max-width: 0px; opacity: 0; overflow: hidden;">
</div>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td align="center" style="background-color: #eeeeee;" bgcolor="#eeeeee">
        <!--[if (gte mso 9)|(IE)]>
        <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
        <tr>
        <td align="center" valign="top" width="600">
        <![endif]-->
        <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
            <tr>
                <td align="center" valign="top" style="font-size:0; padding: 35px;" bgcolor="#0076C0">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="left" valign="top" width="300">
                <![endif]-->
                <div style="display:inline-block; max-width:70%; min-width:100px; vertical-align:top; width:100%;">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:300px;">
                        <tr>
                            <td align="left" valign="top" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 36px; font-weight: 800; line-height: 48px;" class="mobile-center">
                                <h1 style="font-size: 30px; font-weight: 800; margin: 0; color: #ffffff; text-align:center;">Hospitals</h1>
                            </td>
                        </tr>
                    </table>
                </div>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                <td align="right" width="300">
                <![endif]-->
                
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" style="padding: 5px 35px 20px 35px; background-color: #ffffff;" bgcolor="#ffffff">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="center" valign="top" width="600">
                <![endif]-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
                    <tr>
                        <td align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding-top: 10px;">
                            <p style="font-size: 16px; font-weight: 400; line-height: 24px; color: #777777;">
                                To add any notes or discharge a person, simply tap their name, and you'll be taken to the database to update their information.
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" style="padding-top: 20px;">
                            <table cellspacing="0" cellpadding="0" border="0" width="100%">
                              {% workflow where:'WorkflowTypeId == 62' %}
                                  {% assign activeHosp = workflowItems | SortByAttribute:'Hospital' %}
                                  {% for hosp in activeHosp %}
                                    {% assign discharge = hosp | Attribute:'DischargeDate' %}
                                    {% if discharge == "" %}
                                      {% capture updateLink %}{{ 'Global' | Attribute:'InternalApplicationRoot' }}Pastoral/Hospitalization/{{ hosp.Id }}?{{ Person.ImpersonationParameter }}{% endcapture %}
                                      {% assign person = hosp | Attribute:'PersonToVisit','Object' %}                                    
                                        <tr>
                                            <td width="75%" align="left" bgcolor="#eeeeee" colspan="2" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 24px; padding: 10px;">
                                                <a href="{{ updateLink }}" style="color:#0076c0;">{{ person.FullName }} - {{ hosp | Attribute:'Hospital' }}</a>
                                            </td>                                    
                                        </tr>
                                        <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   <i>Admission Notes</I>
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  <i>{{ hosp | Attribute:'AdmitDate' }}: {{ hosp | Attribute:'VisitationRequestDescription' }}</I>
                                              </td>
                                          </tr>
                                      {% workflowactivity where:'ActivityTypeId == 220 && WorkflowId == "{{ hosp.Id }}"' %}
                                          {% assign sortedActivities = workflowactivityItems | SortByAttribute:'VisitDate','desc' %}
                                          {% for activity in sortedActivities limit:1 %}
                                          <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   {{ activity | Attribute:'VisitDate' }}
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  {{ activity | Attribute:'VisitNote' }}
                                              </td>
                                          </tr>
                                          {% endfor %}
                                      {% endworkflowactivity %}
                                    {% endif %}
                                {% endfor %}
                            {% endworkflow %}                              
                            </table>
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" valign="top" style="font-size:0; padding: 35px;" bgcolor="#0076C0">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="left" valign="top" width="300">
                <![endif]-->
                <div style="display:inline-block; max-width:70%; min-width:100px; vertical-align:top; width:100%;">
                    <table align="left" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:500px;">
                        <tr>
                            <td align="left" valign="top" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 36px; font-weight: 800; line-height: 48px;" class="mobile-center">
                                <h1 style="font-size: 30px; font-weight: 800; margin: 0; color: #ffffff; text-align:center;">Nursing Home / Rehab</h1>
                            </td>
                        </tr>
                    </table>
                </div>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                <td align="right" width="300">
                <![endif]-->
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" style="padding: 5px 35px 20px 35px; background-color: #ffffff;" bgcolor="#ffffff">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="center" valign="top" width="600">
                <![endif]-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
                    <tr>
                        <td align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding-top: 10px;">
                            <p style="font-size: 16px; font-weight: 400; line-height: 24px; color: #777777;">
                                To add any notes or discharge a person, simply tap their name, and you'll be taken to the database to update their information.
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" style="padding-top: 20px;">
                            <table cellspacing="0" cellpadding="0" border="0" width="100%">
                              {% workflow where:'WorkflowTypeId == 61' %}
                                  {% assign activeHosp = workflowItems | SortByAttribute:'NursingHome' %}
                                  {% for hosp in activeHosp %}
                                    {% assign discharge = hosp | Attribute:'DischargeDate' %}
                                    {% if discharge == "" %}
                                      {% capture updateLink %}{{ 'Global' | Attribute:'InternalApplicationRoot' }}Pastoral/NursingHome/{{ hosp.Id }}?{{ Person.ImpersonationParameter }}{% endcapture %}
                                      {% assign person = hosp | Attribute:'PersonToVisit','Object' %}
                                      <tr>
                                          <td width="75%" align="left" bgcolor="#eeeeee" colspan="2" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 24px; padding: 10px;">
                                              <a href="{{ updateLink }}" style="color:#0076c0;">{{ person.FullName }} - {{ hosp | Attribute:'NursingHome' }}</a>
                                          </td>                                    
                                      </tr>
                                      <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   <i>Admission Notes</I>
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  <i>{{ hosp | Attribute:'AdmitDate' }}: {{ hosp | Attribute:'VisitationRequestDescription' }}</I>
                                              </td>
                                          </tr>
                                      {% workflowactivity where:'ActivityTypeId == 217 && WorkflowId == "{{ hosp.Id }}"' %}
                                          {% assign sortedActivities = workflowactivityItems | SortByAttribute:'VisitDate','desc' %}
                                          {% for activity in sortedActivities limit:1 %}
                                          <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   {{ activity | Attribute:'VisitDate' }}
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  {{ activity | Attribute:'VisitNote' }}
                                              </td>
                                          </tr> 
                                          {% endfor %}
                                      {% endworkflowactivity %}
                                     {% endif %}
                                  {% endfor %}
                              {% endworkflow %}                             
                            </table>
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            
            <tr>
                <td align="center" valign="top" style="font-size:0; padding: 35px;" bgcolor="#0076C0">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="left" valign="top" width="300">
                <![endif]-->
                <div style="display:inline-block; max-width:70%; min-width:100px; vertical-align:top; width:100%;">
                    <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:300px;">
                        <tr>
                            <td align="left" valign="top" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 36px; font-weight: 800; line-height: 48px;" class="mobile-center">
                                <h1 style="font-size: 30px; font-weight: 800; margin: 0; color: #ffffff; text-align:center;">Homebound</h1>
                            </td>
                        </tr>
                    </table>
                </div>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                <td align="right" width="300">
                <![endif]-->
                
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" style="padding: 5px 35px 20px 35px; background-color: #ffffff;" bgcolor="#ffffff">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="center" valign="top" width="600">
                <![endif]-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
                    <tr>
                        <td align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding-top: 10px;">
                            <p style="font-size: 16px; font-weight: 400; line-height: 24px; color: #777777;">
                                To add any notes or discharge a person, simply tap their name, and you'll be taken to the database to update their information.
                            </p>
                        </td>
                    </tr>
                    <tr>
                        <td align="left" style="padding-top: 20px;">
                            <table cellspacing="0" cellpadding="0" border="0" width="100%">
                              {% workflow where:'WorkflowTypeId == 60' %}
                                  {% assign activeHome = workflowItems %}
                                  {% for home in activeHome %}
                                    {% assign end = home | Attribute:'EndDate' %}
                                    {% if end == "" %}
                                      {% capture updateLink %}{{ 'Global' | Attribute:'InternalApplicationRoot' }}Pastoral/Homebound/{{ home.Id }}?{{ Person.ImpersonationParameter }}{% endcapture %}
                                      {% assign person = home | Attribute:'HomeboundPerson','Object' %}                                    
                                        <tr>
                                            <td width="75%" align="left" bgcolor="#eeeeee" colspan="2" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 800; line-height: 24px; padding: 10px;">
                                                <a href="{{ updateLink }}" style="color:#0076c0;">{{ person.FullName }}</a> - <a href="https://maps.google.com/maps?q={{ person | Address:'Home' }}">{{ person | Address:'Home'}}</a>
                                            </td>                                    
                                        </tr>
                                        <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   <i>Admission Notes</I>
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  <i>{{ home | Attribute:'StartDate' }}: {{ home | Attribute:'HomeboundResidentDescription' }}</I>
                                              </td>
                                          </tr>
                                      {% workflowactivity where:'ActivityTypeId == 213 && WorkflowId == "{{ home.Id }}"' %}
                                          {% assign sortedActivities = workflowactivityItems | SortByAttribute:'VisitDate','desc' %}
                                          {% for activity in sortedActivities limit:2 %}
                                          <tr>
                                              <td width="25%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                   {{ activity | Attribute:'VisitDate' }}
                                              </td>
                                              <td width="75%" align="left" style="font-family: Open Sans, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: 400; line-height: 24px; padding: 15px 10px 5px 10px;">
                                                  {{ activity | Attribute:'VisitNote' }}
                                              </td>
                                          </tr>
                                          {% endfor %}
                                      {% endworkflowactivity %}
                                    {% endif %}
                                {% endfor %}
                            {% endworkflow %}                              
                            </table>
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
            <tr>
                <td align="center" style=" padding: 35px; background-color: #ffffff;" bgcolor="#1b9ba3">
                <!--[if (gte mso 9)|(IE)]>
                <table align="center" border="0" cellspacing="0" cellpadding="0" width="600">
                <tr>
                <td align="center" valign="top" width="600">
                <![endif]-->
                <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;">
                    <tr>
                        <td align="center" style="padding: 25px 0 15px 0;">
                            <table border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td align="center" style="border-radius: 5px;" bgcolor="#66b3b7">
                                      <a href="https://google.com" target="_blank" style="font-size: 18px; font-family: Open Sans, Helvetica, Arial, sans-serif; color: #ffffff; text-decoration: none; border-radius: 5px; background-color: #0076c0; padding: 15px 30px; border: 1px solid #0076c0; display: block;">POC / Hospital Calendar</a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <!--[if (gte mso 9)|(IE)]>
                </td>
                </tr>
                </table>
                <![endif]-->
                </td>
            </tr>
        </table>
        <!--[if (gte mso 9)|(IE)]>
        </td>
        </tr>
        </table>
        <![endif]-->
        </td>
    </tr>
</table>
    
</body>
</html>