diff options
author | Bjørn Christian Seime <bjorncs@vespa.ai> | 2023-10-12 15:57:28 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@vespa.ai> | 2023-10-12 15:57:28 +0200 |
commit | 65b2ed282c186772cff0735f6de4b6bab64f3a89 (patch) | |
tree | 14c568e8ad3ff9368a2607caf40c5853048f368f /controller-server/src/main/resources | |
parent | 399c88527dd838622fa12a9e9218e485d0d282b4 (diff) |
Add custom email content to notification
Render emails using Apache Velocity
Diffstat (limited to 'controller-server/src/main/resources')
-rw-r--r-- | controller-server/src/main/resources/mail/default-mail-content.vm | 131 | ||||
-rw-r--r-- | controller-server/src/main/resources/mail/mail.vm (renamed from controller-server/src/main/resources/mail/mail-notification.tmpl) | 143 | ||||
-rw-r--r-- | controller-server/src/main/resources/mail/notification-message.vm | 6 |
3 files changed, 144 insertions, 136 deletions
diff --git a/controller-server/src/main/resources/mail/default-mail-content.vm b/controller-server/src/main/resources/mail/default-mail-content.vm new file mode 100644 index 00000000000..02de98b900d --- /dev/null +++ b/controller-server/src/main/resources/mail/default-mail-content.vm @@ -0,0 +1,131 @@ +<tbody> +<tr> + <td + align="left" + style=" + font-size: 0px; + padding: 0px 25px 0px 25px; + padding-top: 0px; + padding-right: 50px; + padding-bottom: 0px; + padding-left: 50px; + word-break: break-word; + " + > + <div + style=" + font-family: Open Sans, Helvetica, Arial, + sans-serif; + font-size: 13px; + line-height: 22px; + text-align: left; + color: #797e82; + " + > + <h1 + style=" + text-align: center; + color: #000000; + line-height: 32px; + " + > + $esc.html($mailTitle) + </h1> + </div> + </td> +</tr> +<tr> + <td + align="left" + style=" + font-size: 0px; + padding: 0px 25px 0px 25px; + padding-top: 0px; + padding-right: 50px; + padding-bottom: 0px; + padding-left: 50px; + word-break: break-word; + " + > + <div + style=" + font-family: Open Sans, Helvetica, Arial, + sans-serif; + font-size: 13px; + line-height: 22px; + text-align: left; + color: #797e82; + " + > + + #parse($mailMessageTemplate) + + </div> + </td> +</tr> +<tr> + <td + align="center" + vertical-align="middle" + style=" + font-size: 0px; + padding: 10px 25px; + padding-top: 20px; + padding-bottom: 20px; + word-break: break-word; + " + > + <table + border="0" + cellpadding="0" + cellspacing="0" + role="presentation" + style="border-collapse: separate; line-height: 100%" + > + <tbody> + <tr> + <td + align="center" + bgcolor="#005A8E" + role="presentation" + style=" + border: none; + border-radius: 100px; + cursor: auto; + mso-padding-alt: 15px 25px 15px 25px; + background: #005a8e; + " + valign="middle" + > + <a + href="$consoleLink" + style=" + display: inline-block; + background: #005a8e; + color: #ffffff; + font-family: Open Sans, Helvetica, Arial, + sans-serif; + font-size: 13px; + font-weight: normal; + line-height: 120%; + margin: 0; + text-decoration: none; + text-transform: none; + padding: 15px 25px 15px 25px; + mso-padding-alt: 0px; + border-radius: 100px; + " + target="_blank" + ><b style="font-weight: 700" + ><b style="font-weight: 700" + >Go to Console</b + ></b + ></a + > + </td> + </tr> + </tbody> + </table> + </td> +</tr> +</tbody>
\ No newline at end of file diff --git a/controller-server/src/main/resources/mail/mail-notification.tmpl b/controller-server/src/main/resources/mail/mail.vm index 5bf5530b433..1dbec781b3a 100644 --- a/controller-server/src/main/resources/mail/mail-notification.tmpl +++ b/controller-server/src/main/resources/mail/mail.vm @@ -383,138 +383,9 @@ style="vertical-align: top" width="100%" > - <tbody> - <tr> - <td - align="left" - style=" - font-size: 0px; - padding: 0px 25px 0px 25px; - padding-top: 0px; - padding-right: 50px; - padding-bottom: 0px; - padding-left: 50px; - word-break: break-word; - " - > - <div - style=" - font-family: Open Sans, Helvetica, Arial, - sans-serif; - font-size: 13px; - line-height: 22px; - text-align: left; - color: #797e82; - " - > - <h1 - style=" - text-align: center; - color: #000000; - line-height: 32px; - " - > - Vespa Cloud Notifications - </h1> - </div> - </td> - </tr> - <tr> - <td - align="left" - style=" - font-size: 0px; - padding: 0px 25px 0px 25px; - padding-top: 0px; - padding-right: 50px; - padding-bottom: 0px; - padding-left: 50px; - word-break: break-word; - " - > - <div - style=" - font-family: Open Sans, Helvetica, Arial, - sans-serif; - font-size: 13px; - line-height: 22px; - text-align: left; - color: #797e82; - " - > - <p> - [[NOTIFICATION_HEADER]]: - </p> - [[NOTIFICATION_ITEMS]] - </div> - </td> - </tr> - <tr> - <td - align="center" - vertical-align="middle" - style=" - font-size: 0px; - padding: 10px 25px; - padding-top: 20px; - padding-bottom: 20px; - word-break: break-word; - " - > - <table - border="0" - cellpadding="0" - cellspacing="0" - role="presentation" - style="border-collapse: separate; line-height: 100%" - > - <tbody> - <tr> - <td - align="center" - bgcolor="#005A8E" - role="presentation" - style=" - border: none; - border-radius: 100px; - cursor: auto; - mso-padding-alt: 15px 25px 15px 25px; - background: #005a8e; - " - valign="middle" - > - <a - href="[[LINK_TO_NOTIFICATION]]" - style=" - display: inline-block; - background: #005a8e; - color: #ffffff; - font-family: Open Sans, Helvetica, Arial, - sans-serif; - font-size: 13px; - font-weight: normal; - line-height: 120%; - margin: 0; - text-decoration: none; - text-transform: none; - padding: 15px 25px 15px 25px; - mso-padding-alt: 0px; - border-radius: 100px; - " - target="_blank" - ><b style="font-weight: 700" - ><b style="font-weight: 700" - >Go to Console</b - ></b - ></a - > - </td> - </tr> - </tbody> - </table> - </td> - </tr> - </tbody> + + #parse($mailBodyTemplate) + </table> </div> <!--[if mso | IE]></td></tr></table><![endif]--> @@ -592,7 +463,7 @@ target="_blank" rel="noopener noreferrer" style="color: #005a8e" - href="[[LINK_TO_PRIVACY_POLICY]]" + href="$privacyPolicyLink" ><span style="color: #005a8e" >Yahoo Privacy Policy</span ></a @@ -602,7 +473,7 @@ target="_blank" rel="noopener noreferrer" style="color: #005a8e" - href="[[LINK_TO_TERMS_OF_SERVICE]]" + href="$termsOfServiceLink" ><span style="color: #005a8e" >Terms of Service</span ></a @@ -612,7 +483,7 @@ target="_blank" rel="noopener noreferrer" style="color: #005a8e" - href="[[LINK_TO_SUPPORT]]" + href="$supportLink" ><span style="color: #005a8e">Support</span></a > </p> @@ -621,7 +492,7 @@ target="_blank" rel="noopener noreferrer" style="color: inherit; text-decoration: none" - href="[[LINK_TO_ACCOUNT_NOTIFICATIONS]]" + href="$accountNotificationLink" >Click <span style="color: #005a8e"><u>here</u></span> to manage your notifications setting.</a diff --git a/controller-server/src/main/resources/mail/notification-message.vm b/controller-server/src/main/resources/mail/notification-message.vm new file mode 100644 index 00000000000..29673d38420 --- /dev/null +++ b/controller-server/src/main/resources/mail/notification-message.vm @@ -0,0 +1,6 @@ +<p> + $esc.html($notificationHeader): +</p> +#foreach( $i in $notificationItems ) +<p>$i</p> +#end |