It kpi maillist template engine

Post on 16-Jul-2015

35 views 2 download

Tags:

transcript

IT KPI Maillist Template

Engine

Intro

Login

Dashboard

1 step: configure templates

TemplatesTemplate engine is based on Django Templates, so all features of

https://docs.djangoproject.com/en/1.8/topics/templates/ can be used

base.html is global template taken from

MailChimp 1-column template. Should be

configured just once, and changed only to change

CSS / base layout of mail

event.html contains template for just one event.

Every event in the digest will be rendered using

this template

level_sign.html used to show green/yellow/red

sign depending on event level

digest_new.html is main template that should be

chosen in digest generation. It is inherited from

base.html and includes all selected events.

event.html template

<h3>{{ event.title }} {% include "level_sign.html" %}</h3>

{% if event.when %}<p>{{ event.when | date:"d M Y" }}, о {{ event.when | time:"H:i" }}</p>

{% endif %}

{% if event.speaker %}<p>

<b>Спікери:</b> {{ event.speaker | safe }}</p>{% endif %}

<p><b>Розклад</b>{{ event.agenda | safe }}

</p>

{% if event.image_url %}<img src="{{ event.image_url }}" alt="image for {{ event.title }}"

style="width:300px" />{% endif %}

<p><i>{{ event.description | safe }}</i>

</p><hr />

<p><b>Місце проведення:</b> {{ event.place | safe }}

</p>

Django template language is pretty straightforward:

variables can be included using double curly braces, e.g. {{ event.title }}

Available event fields so far:

● title

● agenda

● description

● speaker

● image_url

● level

● place

● when

Template variablesIn the “variables” field of template you can specify custom ones. You should do it only once in the main

template, in our setup it’s “digest_new.html”.

Note that variables should be specified in format (~!~ is separation sequence):

<var>:= <varname1>|<varname1>=<default_value1>

<variables> := <var>|<variables>~!~<var>

Example:

title~!~top_tagline=Дайджест подій від ІТ КПІ~!~greeting=Привіт, друже!

Note that default value is not required, however it will be used in preview generation.

It’s recommended to specify it.

Adding event

2 step: adding events

Fill the form

Preview events (1)

3 step: preview

1. select event(s)

2. choose “Preview” action

Preview events (2)Enjoy your preview

Creating the real Digest (1)

4 step: generating the digest

1. select event(s)

2. choose “Generate” action

Creating the real Digest (2)

Fill your template variables

Creating the real Digest (3)Review the preview and choose the mailing list (it comes from MailChimp API), then click

Submit

Creating the real Digest (4)

1. Fill email subject and sender

credentials, click Submit.2. Open generated link

Creating the real Digest (5)

Review&fix generated mail and confirm sending the campaign

Q&A

All feature requests / bugreports are welcomed here

https://github.com/itkpi/itkpimail/issues