Implement email template generation

Variables are surrounded by {}, and initial (default) templates are
generated on demand from the plaintext version of emails. The custom
emails are intended to only be used if the user actually changes them,
as they lose the features of the default ones, such as tables.
This commit is contained in:
Harvey Tindall
2021-02-19 21:38:20 +00:00
parent 5c87d109a3
commit eb406ef951
23 changed files with 322 additions and 106 deletions
+1 -1
View File
@@ -64,7 +64,7 @@
<p>{{ .clickBelow }}</p>
<p>{{ .ifItWasNotYou }}</p>
</mj-text>
<mj-button mj-class="blue bold" href="{{ .urlVal }}">{{ .confirmEmail }}</mj-button>
<mj-button mj-class="blue bold" href="{{ .confirmationURL }}">{{ .confirmEmail }}</mj-button>
</mj-column>
</mj-section>
<mj-section mj-class="bg2">
+1 -1
View File
@@ -3,6 +3,6 @@
{{ .clickBelow }}
{{ .ifItWasNotYou }}
{{ .urlVal }}
{{ .confirmationURL }}
{{ .message }}
+6 -6
View File
@@ -64,14 +64,14 @@
</mj-text>
<mj-table mj-class="text" container-background-color="#242424">
<tr style="text-align: left;">
<th>{{ .name }}</th>
<th>{{ .address }}</th>
<th>{{ .time }}</th>
<th>{{ .nameString }}</th>
<th>{{ .addressString }}</th>
<th>{{ .timeString }}</th>
</tr>
<tr style="font-style: italic; text-align: left; color: rgb(153,153,153);">
<th>{{ .nameVal }}</th>
<th>{{ .addressVal }}</th>
<th>{{ .timeVal }}</th>
<th>{{ .name }}</th>
<th>{{ .address }}</th>
<th>{{ .time }}</th>
</mj-table>
</mj-column>
</mj-section>
+3 -3
View File
@@ -1,7 +1,7 @@
{{ .aUserWasCreated }}
{{ .name }}: {{ .nameVal }}
{{ .address }}: {{ .addressVal }}
{{ .time }}: {{ .timeVal }}
{{ .nameString }}: {{ .name }}
{{ .addressString }}: {{ .address }}
{{ .timeString }}: {{ .time }}
{{ .notificationNotice }}
+1 -1
View File
@@ -61,7 +61,7 @@
<mj-column>
<mj-text mj-class="text" font-size="16px" font-family="Noto Sans, Helvetica, Arial, sans-serif">
<h3>{{ .yourAccountWasDeleted }}</h3>
<p>{{ .reason }}: <i>{{ .reasonVal }}</i></p>
<p>{{ .reasonString }}: <i>{{ .reason }}</i></p>
</mj-text>
</mj-column>
</mj-section>
+1 -1
View File
@@ -1,4 +1,4 @@
{{ .yourAccountWasDeleted }}
{{ .reason }}: {{ .reasonVal }}
{{ .reasonString }}: {{ .reason }}
{{ .message }}
+1 -1
View File
@@ -66,7 +66,7 @@
<p>{{ .codeExpiry }}</p>
<p>{{ .ifItWasNotYou }}</p>
</mj-text>
<mj-button mj-class="blue bold"><mj-raw>{{ .pinVal }}</mj-raw></mj-button>
<mj-button mj-class="blue bold"><mj-raw>{{ .pin }}</mj-raw></mj-button>
</mj-column>
</mj-section>
<mj-section mj-class="bg2">
+1 -1
View File
@@ -5,6 +5,6 @@
{{ .codeExpiry }}
{{ .ifItWasNotYou }}
{{ .pin }}: {{ .pinVal }}
{{ .pinString }}: {{ .pin }}
{{ .message }}
+1 -1
View File
@@ -65,7 +65,7 @@
<p>{{ .toJoin }}</p>
<p>{{ .inviteExpiry }}</p>
</mj-text>
<mj-button mj-class="blue bold" href="{{ .invite_link }}">{{ .linkButton }}</mj-button>
<mj-button mj-class="blue bold" href="{{ .inviteURL }}">{{ .linkButton }}</mj-button>
</mj-column>
</mj-section>
<mj-section mj-class="bg2">
+1 -1
View File
@@ -3,6 +3,6 @@
{{ .toJoin }}
{{ .inviteExpiry }}
{{ .invite_link }}
{{ .inviteURL }}
{{ .message }}
+2 -2
View File
@@ -62,8 +62,8 @@
<mj-text mj-class="text" font-size="16px" font-family="Noto Sans, Helvetica, Arial, sans-serif">
<h3>{{ .welcome }}</h3>
<p>{{ .youCanLoginWith }}:</p>
{{ .jellyfinURL }}: <a href="{{ .jellyfinURLVal }}">{{ .jellyfinURLVal }}</a>
<p>{{ .username }}: <i>{{ .usernameVal }}</i></p>
{{ .jellyfinURLString }}: <a href="{{ .jellyfinURLVal }}">{{ .jellyfinURL }}</a>
<p>{{ .usernameString }}: <i>{{ .username }}</i></p>
</mj-text>
</mj-column>
</mj-section>
+2 -2
View File
@@ -2,8 +2,8 @@
{{ .youCanLoginWith }}:
{{ .jellyfinURL }}: {{ .jellyfinURLVal }}
{{ .username }}: {{ .usernameVal }}
{{ .jellyfinURLString }}: {{ .jellyfinURL }}
{{ .usernameString }}: {{ .username }}
{{ .message }}