Recipe - Send a list of Recipients in the body of an Email
Skill level: Beginner
Organization: Kevin Rutledge
Requires Rock: 1.8.0
{# strip images & classes from the HTML but otherwise leave structure #}
There have been times when I want to send an email to a group of people, but I want them to know who else received the email. Since group emails with everyone in the To field won't work, I wrote a lava shortcode that when present without an id, includes everyone who received the current communication. If Id is present, you can actually include a list of people who received a different email. Here the recipe.
Create a Lava Shortcode:
Name: Communication Recipient List
Tag Name: recipients
Tag Type: Inline
Description: Creates an unordered list of recipients who received an email when it was sent.
Documentation:
This shortcode gives a list of recipients when of an email at the time of sending. You may have to save the draft when you add new people.
{[ recipients ]} will give a bulleted list of the recipients of the current email.
{[ recipients id:'#' ]} will give a bulleted list of recipients of a previous email.
{[ recipients showemail:'true' ]} will include the person's email address in the list.
Lava:
<ul>
{% if id == '' %}
{% assign recipients = Communication.Recipients %}
{% for personid in recipients %}
{% assign person = personid.PersonAliasId | PersonByAliasId %}
<li>{{person.NickName}} {{person.LastName }}{% if showemail == 'true' %} - {{person.Email}}{% endif %}</li>
{% endfor %}
{% else %}
{% communicationrecipient Where:'CommunicationId =={{ id }}' %}
{% for personinfo in communicationrecipientItems %}
{% assign person = personinfo.PersonAlias.Person %}
<li>{{person.NickName}} {{person.LastName }}{% if showemail == 'true' %} - {{person.Email}}{% endif %}</li>
{% endfor %}
{% endcommunicationrecipient %}
{% endif %}
</ul>
Parameters:
id: blank
showemail: false
Enabled Lava Commands: Rock Entity