Skip to content

Example Email Template

chmarr edited this page Nov 26, 2012 · 2 revisions

Note: Not updated for new codebase. New codebase includes "All Inclusive Template" in its fixtures with the correct variable names.

Here's an example Email template. Not intended for use without modification, but contains just about every loop and variable that you could possibly want to send to artists.

Clearly, the template goes through Django's template parsing code. {% autoescape off %} is added around the template automatically. Paragraphs starting with a period are word-wrapped to 76 columns. Everything else is sent to email as is.

.If you see this, then the admin hit the "send" button without checking the content first. Please begin throwing your tomatoes.

Real Name: {{ artist.name }}
Public Name: {{ artist.artistname }}
Address:
    {{ artist.address1 }}{% if artist.address2 %}
    {{ artist.address2 }}{% endif %}
    {{ artist.city }} {{ artist.state }} {{ artist.postcode }}
    {{ artist.country }}
Phone: {{ artist.phone }}
Email: {{ artist.email }}
Mail-In?: {{ artist.mailin }}
Agent:    {{ artist.agent }}

Spaces Allocated / Requested:{% for s in artist.allocation_set.all %}
    {{ s.space.name }}: {{ s.allocated }} / {{ s.requested }}{% endfor %}

Pieces in show
--------------
{% for piece in pieces_in_show %}{{ piece.pieceid }}. {{ piece.name }} - {% if piece.top_bid %}${{ piece.top_bid.amount }}{% if piece.voice_auction %} Voice Auctioned{% endif %}{% if piece.top_bid.buy_now_bid %} Buy Now{% endif %}
    {{ piece.top_bid.bidder.name }}
    {{ piece.top_bid.bidder.address1 }} {{ piece.top_bid.bidder.address2 }} {{ piece.top_bid.bidder.city }} {{ piece.top_bid.bidder.state }} {{ piece.top_bid.bidder.postcode }} {{ piece.top_bid.bidder.country }}
    {{ piece.top_bid.bidder.email }}{% else %}No bids{% endif %}

{% empty %}No pieces in show.

{% endfor %}
Accounting
----------
{% for p in payments %}{{ p.date }}: {{ p.description|ljust:"50" }}: ${{ p.amount|stringformat:"8.2f" }}
{% empty %}No accounting items, in or out.

{% endfor %}

{{ artshow_settings.ARTSHOW_EMAIL_FOOTER }}
Clone this wiki locally