2018-09-24 00:45:13 +08:00
|
|
|
<p>Hello <%= @user.name %>,</p>
|
2016-10-05 16:52:27 +08:00
|
|
|
|
2018-09-24 00:45:13 +08:00
|
|
|
<% unless @notification.deliver? %>
|
|
|
|
<p><%= I18n.t("notifications.email_title") %></p>
|
|
|
|
<p>Type: <%= I18n.t("notifications.types.#{@notification.type_of}") %></p>
|
|
|
|
<% end %>
|
2016-10-05 16:52:27 +08:00
|
|
|
|
2017-02-10 22:13:33 +08:00
|
|
|
<p>
|
2018-09-24 00:45:13 +08:00
|
|
|
<% if @notification.system_message? %>
|
2017-02-10 22:13:33 +08:00
|
|
|
<% # We assume the system notification is clean %>
|
|
|
|
<%= @notification.title.html_safe %>
|
2018-09-24 00:45:13 +08:00
|
|
|
<% elsif @notification.deliver? %>
|
2018-11-24 00:24:10 +08:00
|
|
|
<p><%= I18n.t("notifications.deliver.email_body_1") %></p>
|
|
|
|
<p><%= I18n.t("notifications.deliver.email_body_2") %></p>
|
2017-02-10 22:13:33 +08:00
|
|
|
<% else %>
|
|
|
|
<%= sanitize_input(prepend_server_url_to_links(@notification.title)) %>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
2016-10-05 16:52:27 +08:00
|
|
|
|
2017-02-10 22:13:33 +08:00
|
|
|
<p>
|
|
|
|
<% if @notification.system_message? %>
|
|
|
|
<% # We assume the system notification is clean %>
|
|
|
|
<%= @notification.message.html_safe %>
|
2023-09-18 21:30:11 +08:00
|
|
|
<% elsif @notification.deliver? && @notification.message.match?(/data-id=('|")(\d*)('|")/) && @notification.message.match?(/href=('|")\/zip_exports/) %>
|
2018-09-24 00:45:13 +08:00
|
|
|
<%= I18n.t("notifications.deliver.download_link") %>
|
2018-11-24 00:24:10 +08:00
|
|
|
<% # work around the problem with inserting the link of zipExport %>
|
|
|
|
<% zip_id = /data-id=('|")(\d*)('|")/.match(@notification.message)[2] %>
|
2018-12-07 22:02:45 +08:00
|
|
|
<% if /download_export_all_zip/.match(@notification.message) %>
|
|
|
|
<% download_url = zip_exports_download_export_all_url(zip_id) %>
|
|
|
|
<% else %>
|
|
|
|
<% download_url = zip_exports_download_url(zip_id) %>
|
|
|
|
<% end %>
|
|
|
|
<%= @notification.message.gsub(/href='.+'/, "href='#{download_url}'").html_safe %>
|
2017-02-10 22:13:33 +08:00
|
|
|
<% else %>
|
|
|
|
<%= sanitize_input(prepend_server_url_to_links(@notification.message)) %>
|
|
|
|
<% end %>
|
|
|
|
</p>
|