As we began to standardize emails sent from the various ministries within our church, we found that more and more people wanted templates created with their staff picture and contact info in a signature. Instead of creating a template per staff person, I found a way to use a Lava shortcode that dynamically pulls the info from the sender's Rock profile. Here's what ours looks like and how it was created!

staffSignature.png

Prerequisites:

1. Decide on the design of your signature: building your signature out in HTML first ensures you have it exactly the way you want it to look, so as you begin to plugin the Lava values, you know what outcome you're expecting.

2. Ensure staff Rock profiles are configured with their staff email: the "from" email address in the Communication is being used to determine whose signature to apply. It's looking up the info to put into the signature based on the email address, so it's important that staff profiles have their staff email configured.

3. Check the Global Attributes: the 'OrganizationPhone' already exists, but I needed an unformatted version of our phone number. So I created an 'OrganizationPhoneUnformatted' text attribute with our main number.

4. Add Person Attributes (optional, depends on your signature): we wanted to include the staff member's position and let them choose which phone number to include in their signature (corporate, mobile, or office). To accomplish this, I created a "Preferred Number" attribute on the Person page that lets them choose which phone number to include. We also have an "Employment" section that lets us store the person's employer and position.

personAttributes.png


Testing the Lava:

It's probably best to start with the Lava Tester (Admin > Power Tools > Lava Tester, installed via a plugin). Starting here ensures you're able to visually confirm it's looking how you intend it to as you begin to plugin the Lava variables.

Here's our HTML signature, no Lava.

<div class="about" style="background-color: #fff; width: 560px; margin-bottom: 30px; line-height: 20px; padding: 10px;">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tbody>
      <tr>
        <td align="left">
          <table>
            <tbody>
              <tr>
                <td>
                  <img src="https://rocksolidchurch.com/assets/staffpictures/firstlast.jpg" style="width: 100px; margin-right: 10px; border-radius: 50%;">
                </td>
                <td>
                  <h3 style="margin-bottom: 5px; margin-top: 0px;">First Last</h3>
                  Position Title <br>
                  <span style="font-size: 14px;">
                    <a href="tel:1234567890" style="color: rgb(3, 94, 97);">(123) 456-7890</a>
                    <a href="mailto:firstlast@rocksolidchurch.com" style="color: rgb(3, 94, 97);">firstlast@rocksolidchurch.com</a>
                  </span>
                </td>
              </tr>
            </tbody>
          </table>
        </td>
      </tr>
    </tbody>
  </table>
</div>


Here's our HTML signature, final product with Lava (used in Lava tester, the "Email" check at the top is a parameter in the shortcode itself):

 {% person where:'Email == "firstlast@rocksolidchurch.com"' %}
  <div class="about" style="background-color: #fff; width: 560px; margin-bottom: 30px; line-height: 20px; padding: 10px;">
    <table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td align="left">
    <table>
      <tbody><tr>
        <td>
          <img src="https://rocksolidchurch.com/assets/staffpictures/{{ person.NickName | Downcase}}{{ person.LastName | Downcase }}.jpg" style="width: 100px; margin-right: 10px; border-radius: 50%;">
        </td>
        <td>
          <h3 style="margin-bottom: 5px; margin-top: 0px;">{{ person.NickName }} {{ person.LastName }}</h3>
          {{ person | Attribute:'Position' }}<br>
            {% case person | Attribute:'PreferredNumber' %}
            {% when 'Corporate' %}
                <span style="font-size: 14px;"><a href="tel:{{ 'Global' | Attribute:'OrganizationPhoneUnformatted' }}" style="color: rgb(3, 94, 97);">{{ 'Global' | Attribute:'OrganizationPhone' }}/a> | 
            {% when 'Mobile' %}
                <span style="font-size: 14px;"><a href="tel:{{ person | PhoneNumber: 'Mobile', true | Remove:'(' | Remove:')' | Remove: ' ' | Remove: '-' }}" style="color: rgb(3, 94, 97);">{{ person | PhoneNumber: 'Mobile' }}</a> | 
            {% when 'Work' %}
                <span style="font-size: 14px;"><a href="tel:{{ person | PhoneNumber: 'Work', true | Remove:'(' | Remove:')' | Remove: ' ' | Remove: '-' }}" style="color: rgb(3, 94, 97);">{{ person | PhoneNumber: 'Work' }}</a> | 
            {% when 'Home' %}
                <span style="font-size: 14px;"><a href="tel:{{ person | PhoneNumber: 'Home', true | Remove:'(' | Remove:')' | Remove: ' ' | Remove: '-' }}" style="color: rgb(3, 94, 97);">{{ person | PhoneNumber: 'Home' }}</a> | 
            {% else %}
                <span style="font-size: 14px;"><a href="tel:{{ 'Global' | Attribute:'OrganizationPhoneUnformatted' }}" style="color: rgb(3, 94, 97);">{{ 'Global' | Attribute:'OrganizationPhone' }}</a> | 
            {% endcase %}
           <a href="mailto:{{ person.Email }}" style="color: rgb(3, 94, 97);">{{ person.Email }}</a></span>
        </td>
      </tr>
    </tbody></table>
    </td></tr></tbody></table>
  </div>
{% endperson %}


Writing the Lava shortcode:

The shortcode can be created at Admin > CMS Configuration > Lava Shortcodes and can be configured as follows:

Name: Church Standard Staff Signature

Tag Name: signature

TagType: Inline

Description: Display the Church's Standard Staff Signature, primarily intended for use within communication templates.

Parameters:

  • fromemail 
  • signatureParameter.png

Enabled Lava Commands: RockEntity

Shortcode Markup (you'll need to change the URL to where your staff pictures are located):

 {% person where:'Email == "{{ fromemail }}"' %}
  <div class="about" style="background-color: #fff; width: 560px; margin-bottom: 30px; line-height: 20px; padding: 10px;">
    <table width="100%" border="0" cellspacing="0" cellpadding="0"><tbody><tr><td align="left">
    <table>
      <tbody><tr>
        <td>
          <img src="https://rocksolidchurch.com/assets/staffpictures/{{ person.NickName | Downcase}}{{ person.LastName | Downcase }}.jpg" style="width: 100px; margin-right: 10px; border-radius: 50%;">
        </td>
        <td>
          <h3 style="margin-bottom: 5px; margin-top: 0px;">{{ person.NickName }} {{ person.LastName }}</h3>
          {{ person | Attribute:'Position' }}<br>
            {% case person | Attribute:'PreferredNumber' %}
            {% when 'Corporate' %}
                <span style="font-size: 14px;"><a href="tel:{{ 'Global' | Attribute:'OrganizationPhoneUnformatted' }}" style="color: rgb(3, 94, 97);">{{ 'Global' | Attribute:'OrganizationPhone' }}/a> | 
            {% when 'Mobile' %}
                <span style="font-size: 14px;"><a href="tel:{{ person | PhoneNumber: 'Mobile', true | Remove:'(' | Remove:')' | Remove: ' ' | Remove: '-' }}" style="color: rgb(3, 94, 97);">{{ person | PhoneNumber: 'Mobile' }}</a> | 
            {% when 'Work' %}
                <span style="font-size: 14px;"><a href="tel:{{ person | PhoneNumber: 'Work', true | Remove:'(' | Remove:')' | Remove: ' ' | Remove: '-' }}" style="color: rgb(3, 94, 97);">{{ person | PhoneNumber: 'Work' }}</a> | 
            {% when 'Home' %}
                <span style="font-size: 14px;"><a href="tel:{{ person | PhoneNumber: 'Home', true | Remove:'(' | Remove:')' | Remove: ' ' | Remove: '-' }}" style="color: rgb(3, 94, 97);">{{ person | PhoneNumber: 'Home' }}</a> | 
            {% else %}
                <span style="font-size: 14px;"><a href="tel:{{ 'Global' | Attribute:'OrganizationPhoneUnformatted' }}" style="color: rgb(3, 94, 97);">{{ 'Global' | Attribute:'OrganizationPhone' }}</a> | 
            {% endcase %}
           <a href="mailto:{{ person.Email }}" style="color: rgb(3, 94, 97);">{{ person.Email }}</a></span>
        </td>
      </tr>
    </tbody></table>
    </td></tr></tbody></table>
  </div>
{% endperson %}


Usage of the shortcode:

When using the shortcode in the Lava tester, it will work like shown below. All it needs is an email address!

{[ signature fromemail:'firstlast@rocksolidchurch.com' ]}

When using the shortcode in a Communication Template, add the {% raw %} tags and pass it the Communication's from email:

{% raw %} {[ signature fromemail:'{{ Communication.FromEmail }}' ]} {% endraw %}