Donor Conditional Content

Donors Only

You can use the hpc_raw variable as a boolean, since it will return a true-y value if the constituent is a donor, and a false-y value if the constituent is not a donor.

{% if hpc_raw %}
DONOR ONLY CONTENT HERE
{%endif%}

Non-Donors Only

{% if not hpc_raw %}
NONDONOR ONLY CONTENT HERE
{%endif%}

Conditional content for both QD and non-QD users

{% if recipient.hasSavedPaymentInfo %}

QUICK DONATE USERS SEE THE CONTENT HERE

{% else %}

NON-QD USERS SEE THE CONTENT HERE

{% endif %}

Conditional content for only QD users

{% if recipient.hasSavedPaymentInfo %}

QUICK DONATE USERS SEE THE CONTENT HERE

{% endif %}

Conditional content with ActBlue Express

{# Customize these variables #}
{% set hasActBlue = cons.inConsGroup(1) %}
{% set quickDonateSlug = 'quickdonate' %}
{% set fallbackSlug = 'default' %}
{% set amounts = [5, 10, 20, 50] %}
{% set toolsDomain = 'https://client.bsd.net/' %}
{# QuickDonate #}
{% if recipient.hasSavedPaymentInfo %}
{% for amount in amounts %}
<p><a href="{{toolsDomain}}{{ qd_link(quickDonateSlug, amount) }}">QuickDonate: ${{amount}}</a></p>
{% endfor %}
{# ActBlue #}
{% elseif hasActBlue %}
{# ActBlue disclaimer is required by ActBlue #}
<div class="express-lane-links">
<p class="info">If you&#39;ve saved your payment information with ActBlue Express, your donation will go through immediately:</p>
{% for amount in amounts %}
<p class="link amount"><a href="https://secure.actblue.com/donate/ew-branding-1-navy-test?express_lane=true&amount={{amount}}&refcode=express_lane_{{amount}}">Express Donate: ${{amount}}</a></p>
{% endfor %}
<p class="link other"><a href="https://secure.actblue.com/donate/ew-branding-1-navy-test?refcode=express_lane_other">Or, donate another amount</a></p>
</div>
{% else %}
{% for amount in amounts %}
<p><a href="{{toolsDomain}}page/contribute/{{fallbackSlug}}?default_amt={{amount}}">Donate: ${{amount}}</p>
{% endfor %}
{% endif %}

This example will add a QuickDonate link if the recipient has previously enrolled. Failing that if there is a constituent group that has known ActBlue Express constituents (for example synced through an upload), then an link with ActBlue information prefilled will be generated. Otherwise, a default contribution page will be used.