Contribution History Data
For users wishing to personalize with more complexity than the highest previous contribution tags allow, there is an advanced feature giving you access to information about all of a constituent's contributions.
This is a data structure that's available in Twig that contains a list of a user's contributions. You can use this to manipulate the data in the objects to do things like supporter record emails and custom contribution asks.
The tag is called contribution.contributions
. You can inspect its contains by doing:
{% for contrib in contribution.contributions %}
{% for field, val in contrib %}
{{ field}} : {{ val }} <br />
{% endfor%} </p>
{% endfor%}
You'll see that it currently contains the following fields.
Field Name | Example Value | Description |
---|---|---|
cons_action_contribution_id | 1224243 | Internal unique identifier for each contribution. This can be helpful for distinguishing contributions from eachother, but displaying it in the body of the email is not recommended, as it can lead to users deducing how many contributions you've ever had. |
cons_id | 332 | The constituent's ID. This will always be the same as {{ cons.cons_id }} |
transaction_amt | 10.00 | The amount of the transaction, without a currency code, with 2 decimal points. |
transaction_dt | 2014-03-01 12:34:56 | The date of the transaction. Note that for offline contributions this will correspond to the date of the uploaded contribution, not the date it was uploaded. This is expressed in UTC time in most cases, not a localized time zone. |
contribution_page_id | 24 | The identifier of the page the contribution occurred on. Will be null for uploaded contributions that are not tied to a specific page. |
is_recurring | 0 | Whether the transaction was made as a recurring contribution. (1 if recurring, 0 if not) |
is_online | 1 | Whether the transaction was processed online via BSD forms. (1 if online, 0 if not) |
Updated less than a minute ago