Hello <%= @user.name %>,

<% unless @notification.deliver? %>

<%= I18n.t("notifications.email_title") %>

Type: <%= I18n.t("notifications.types.#{@notification.type_of}") %>

<% end %>

<% if @notification.system_message? %> <% # We assume the system notification is clean %> <%= @notification.title.html_safe %> <% elsif @notification.deliver? %>

<%= I18n.t("notifications.deliver.email_body_1") %>

<%= I18n.t("notifications.deliver.email_body_2") %>

<% else %> <%= sanitize_input(prepend_server_url_to_links(@notification.title)) %> <% end %>

<% if @notification.system_message? %> <% # We assume the system notification is clean %> <%= @notification.message.html_safe %> <% elsif @notification.deliver? && @notification.message.match?(/data-id=('|")(\d*)('|")/) && @notification.message.match?(/href=('|")\/zip_exports/) %> <%= I18n.t("notifications.deliver.download_link") %> <% # work around the problem with inserting the link of zipExport %> <% zip_id = /data-id=('|")(\d*)('|")/.match(@notification.message)[2] %> <% 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 %> <% else %> <%= sanitize_input(prepend_server_url_to_links(@notification.message)) %> <% end %>