summary refs log tree commit diff
path: root/res
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-04-29 13:56:21 +0100
committerDavid Baker <dave@matrix.org>2016-04-29 13:56:21 +0100
commit40d40e470d9ff047f4255a93e40af8a9870b43cc (patch)
tree98d988df1773774fda74f55a090bd088d8c43378 /res
parentAdd an email pusher for new users (diff)
downloadsynapse-40d40e470d9ff047f4255a93e40af8a9870b43cc.tar.xz
Send mail notifs with a plaintext part too
Diffstat (limited to 'res')
-rw-r--r--res/templates/notif.txt12
-rw-r--r--res/templates/notif_mail.txt10
-rw-r--r--res/templates/room.txt6
3 files changed, 28 insertions, 0 deletions
diff --git a/res/templates/notif.txt b/res/templates/notif.txt
new file mode 100644
index 0000000000..b515f394c3
--- /dev/null
+++ b/res/templates/notif.txt
@@ -0,0 +1,12 @@
+{% for message in notif.messages %}
+{{ message.sender_name }} ({{ message.ts|format_ts("%H:%M") }})
+{% if message.msgtype == "m.text" %}
+{{ message.body_text_plain }}
+{% elif message.msgtype == "m.image" %}
+{{ message.body_text_plain }}
+{% elif message.msgtype == "m.file" %}
+{{ message.body_text_plain }}
+{% endif %}
+{% endfor %}
+
+View at {{ notif.link }}
diff --git a/res/templates/notif_mail.txt b/res/templates/notif_mail.txt
new file mode 100644
index 0000000000..24843042a5
--- /dev/null
+++ b/res/templates/notif_mail.txt
@@ -0,0 +1,10 @@
+Hi {{ user_display_name }},
+
+{{ summary_text }}
+
+{% for room in rooms %}
+{% include 'room.txt' with context %}
+{% endfor %}
+
+You can disable these notifications at {{ unsubscribe_link }}
+
diff --git a/res/templates/room.txt b/res/templates/room.txt
new file mode 100644
index 0000000000..999d0ae60a
--- /dev/null
+++ b/res/templates/room.txt
@@ -0,0 +1,6 @@
+{{ room.title }}
+You've been invited, join at {{ room.link }}
+
+{% for notif in room.notifs %}
+{% include 'notif.txt' with context %}
+{% endfor %}