Template Variables
Template variables are a concept that have multiple names: "mail merges" might be one you're more familiar with if you have a marketing and email background. The concept is to add snippets in your email that are programmatically replaced when Buttondown sends out an email; this allows you to customize your content per-subscriber or to repeat certain key concepts in your email without having to change them over and over again.
Template variable library
Variable | Description | Example |
---|---|---|
subscriber.can_view_premium_content | Whether or not a subscriber is able to view premium content |
|
subscriber.metadata | Access to the metadata for a given subscriber |
|
subscriber.email | Access to the email address for a given subscriber |
|
subscriber.can_be_upsold | Whether or not a subscriber is able to be upsold to a paid subscription |
|
subscriber.subscriber_type | Access to the subscriber type (premium, regular, etc) for a given subscriber |
|
subscriber.tags | Access to the tag names of a given subscriber |
|
email.subject | The subject of the email you're sending out |
|
unsubscribe_url | A personalized URL for the given subscriber to unsubscribe with |
|
subscribe_url | A generic URL for your subscription page |
|
email_url | The permalink of the email being sent out |
|
upgrade_url | A link to prompt existing free subscribers to upgrade. (Only relevant for paid newsletters.) |
|
premium_subscribe_url | A link to prompt existing free subscribers to upgrade. (Only relevant for paid newsletters.) This is the exact same thing as upgrade_url. |
|
email.secondary_id | The issue number of the email being sent out |
|
email.publish_date | The raw date time of the email being sent out |
|
subscribe_form | An embedded subscribe form for your newsletter, just like the one that appears at the bottom of your archives. Note that this only appears on the web/archive version of your email; it will not appear in the actual emails sent to subscribers. |
|
medium | Either 'email' (for emails) or 'web' (for web views) |
|