it kpi maillist template engine

16
IT KPI Maillist Template Engine Intro

Upload: roman-anigon

Post on 16-Jul-2015

38 views

Category:

Internet


2 download

TRANSCRIPT

Page 1: It kpi maillist template engine

IT KPI Maillist Template

Engine

Intro

Page 2: It kpi maillist template engine

Login

Page 3: It kpi maillist template engine

Dashboard

1 step: configure templates

Page 4: It kpi maillist template engine

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.

Page 5: It kpi maillist template engine

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

Page 6: It kpi maillist template engine

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.

Page 7: It kpi maillist template engine

Adding event

2 step: adding events

Page 8: It kpi maillist template engine

Fill the form

Page 9: It kpi maillist template engine

Preview events (1)

3 step: preview

1. select event(s)

2. choose “Preview” action

Page 10: It kpi maillist template engine

Preview events (2)Enjoy your preview

Page 11: It kpi maillist template engine

Creating the real Digest (1)

4 step: generating the digest

1. select event(s)

2. choose “Generate” action

Page 12: It kpi maillist template engine

Creating the real Digest (2)

Fill your template variables

Page 13: It kpi maillist template engine

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

Submit

Page 14: It kpi maillist template engine

Creating the real Digest (4)

1. Fill email subject and sender

credentials, click Submit.2. Open generated link

Page 15: It kpi maillist template engine

Creating the real Digest (5)

Review&fix generated mail and confirm sending the campaign

Page 16: It kpi maillist template engine

Q&A

All feature requests / bugreports are welcomed here

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