Skip to content

Commit

Permalink
Merge pull request #186 from ibi-group/update-email-templates
Browse files Browse the repository at this point in the history
refactor: reword and add styling to user emails
  • Loading branch information
binh-dam-ibigroup authored Sep 5, 2023
2 parents 9c63b15 + 47fe464 commit 94274fa
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
22 changes: 19 additions & 3 deletions src/main/resources/templates/BaseEmail.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,25 @@
emails that use this must implement a macro called `EmailBody` and the whole html email will
eventually get rendered by the statement <@HtmlEmail/>.
-->
<style>
body {
padding: 1em;
}
h1 {
font-size: 18px;
font-weight: 600;
}
small {
color: #515151
}
</style>

<#macro HtmlEmail>
<div>
<@EmailBody/>
</div>
<body>
<div>
<@EmailBody/>
</div>
</body>
</#macro>
4 changes: 2 additions & 2 deletions src/main/resources/templates/MonitoredTripHtml.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

<#macro EmailMain>
<div>
<p>Your trip has the following notifications:</p>
<h1>Your trip has the following notifications:</h1>
<ul>
<#list notifications as notification>
<li>${notification}</li>
</#list>
</ul>
<p>View trip <a href="${OTP_UI_URL}${TRIPS_PATH}/${tripId}">here</a>.
<p>View all of your saved trips in <a href="${OTP_UI_URL}${TRIPS_PATH}/${tripId}">${OTP_UI_NAME}</a>.</p>
</div>
</#macro>

Expand Down
7 changes: 2 additions & 5 deletions src/main/resources/templates/OtpUserContainer.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@
-->

<#macro EmailBody>
<#-- header -->
<div>
<h2>An email from the ${OTP_UI_NAME}</h2>
</div>
<#-- main -->
<div>
<@EmailMain/>
</div>
<#-- footer -->
<hr/>
<div>
<p>
<small>
Manage Subscriptions <a href="${OTP_UI_URL}/#/account">here</a>.
You're receiving this email because you're subscribed to notifications through ${OTP_UI_NAME}. You can manage that subscription <a href="${OTP_UI_URL}/#/account">here</a>.
</small>
</p>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"\n\n\n<div>\n<div>\n <h2>An email from the OTP Admin Dashboard</h2>\n</div>\n<div>\n <div>\n <h3>test subject</h3>\n <p>\n Visit the\n <a href=\"https://otp-admin-ui.now.sh?dashboard=errors\">OTP Admin Dashboard</a>\n to view new errors.\n </p>\n </div>\n</div>\n<div>\n <p>\n <small>\n Manage subscriptions <a href=\"https://otp-admin-ui.now.sh/account\">here</a>.\n </small>\n </p>\n</div>\n</div>\n"
"<style>\n body { \n padding: 1em;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 600;\n }\n\n small {\n color: #515151\n }\n</style>\n\n\n\n\n<body>\n <div>\n<div>\n <h2>An email from the OTP Admin Dashboard</h2>\n</div>\n<div>\n <div>\n <h3>test subject</h3>\n <p>\n Visit the\n <a href=\"https://otp-admin-ui.now.sh?dashboard=errors\">OTP Admin Dashboard</a>\n to view new errors.\n </p>\n </div>\n</div>\n<div>\n <p>\n <small>\n Manage subscriptions <a href=\"https://otp-admin-ui.now.sh/account\">here</a>.\n </small>\n </p>\n</div>\n </div>\n</body>\n"
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"\n\n\n<div>\n<div>\n <h2>An email from the Trip Planner</h2>\n</div>\n<div>\n <div>\n <p>Your trip has the following notifications:</p>\n <ul>\n <li>Test notification.</li>\n <li>Another notification.</li>\n </ul>\n <p>View trip <a href=\"https://plan.example.com/#/account/trips/18f642d5-f7a8-475a-9469-800129e6c0b3\">here</a>.\n </div>\n</div>\n<div>\n <p>\n <small>\n Manage Subscriptions <a href=\"https://plan.example.com/#/account\">here</a>.\n </small>\n </p>\n</div>\n</div>\n"
"<style>\n body { \n padding: 1em;\n }\n\n h1 {\n font-size: 18px;\n font-weight: 600;\n }\n\n small {\n color: #515151\n }\n</style>\n\n\n\n\n<body>\n <div>\n<div>\n <div>\n <h1>Your trip has the following notifications:</h1>\n <ul>\n <li>Test notification.</li>\n <li>Another notification.</li>\n </ul>\n <p>View all of your saved trips in <a href=\"https://plan.example.com/#/account/trips/18f642d5-f7a8-475a-9469-800129e6c0b3\">Trip Planner</a>.</p>\n </div>\n</div>\n<hr/>\n<div>\n <p>\n <small>\n You're receiving this email because you're subscribed to notifications through Trip Planner. You can manage that subscription <a href=\"https://plan.example.com/#/account\">here</a>.\n </small>\n </p>\n</div>\n </div>\n</body>\n"

0 comments on commit 94274fa

Please sign in to comment.