Add logo to email header block

pull/9613/head
Henriette Darge 3 years ago
parent 80253c71ea
commit 9447285404
  1. 9
      app/assets/images/logo_openproject_narrow.svg
  2. 5
      app/helpers/mail_digest_helper.rb
  3. 39
      app/views/digest_mailer/work_packages.html.erb
  4. 1
      config/locales/en.yml

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 52 KiB

@ -49,6 +49,11 @@ module MailDigestHelper
timestamp_text(user, journal, extended_text)
end
def email_image_tag(image, **options)
attachments[image] = File.read(Rails.root.join("app/assets/images/#{image}"))
image_tag attachments[image].url, **options
end
def unique_reasons_of_notifications(notifications)
notifications
.map(&:reason_mail_digest)

@ -1,21 +1,30 @@
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-bottom: 1px solid #cccccc; margin-bottom: 30px;">
<tr>
<td style="font-size: 24px; color: #333333; padding-bottom: 10px;">
<%= I18n.t(:'mail.digests.salutation', user: @user.firstname) %>
<td style="width: 82px; height: 82px; vertical-align: top;">
<%= email_image_tag("logo_openproject_narrow.svg", alt: I18n.t(:'mail.logo_alt_text')) %>
</td>
</tr>
<tr>
<td style="font-size:14px; color: #1A67A3; font-weight: bold; padding-bottom: 10px;">
<%= digest_timespan_text(@notification_ids.length, @aggregated_notifications.length) %>
</td>
</tr>
<tr>
<td style="padding: 10px 0 25px 0;">
<a href="<%= notifications_center_url %>"
target="_blank"
style="background: #D1E5F5; padding: 8px 12px; color: #1A67A3; border: 1px solid #1A67A3; border-radius: 16px; text-decoration: none;">
<%= I18n.t(:'mail.digests.center') %>
</a>
<td width="100%" style="padding-top: 8px;">
<table>
<tr>
<td style="font-size: 24px; color: #333333; padding-bottom: 5px;">
<%= I18n.t(:'mail.digests.salutation', user: @user.firstname) %>
</td>
</tr>
<tr>
<td style="font-size:14px; color: #1A67A3; font-weight: bold; padding-bottom: 10px;">
<%= digest_timespan_text(@notification_ids.length, @aggregated_notifications.length) %>
</td>
</tr>
<tr>
<td style="padding: 10px 0 25px 0;">
<a href="<%= notifications_center_url %>"
target="_blank"
style="background: #D1E5F5; padding: 8px 12px; color: #1A67A3; border: 1px solid #1A67A3; border-radius: 16px; text-decoration: none;">
<%= I18n.t(:'mail.digests.center') %>
</a>
</td>
</tr>
</table>
</td>
</tr>
</table>

@ -1988,6 +1988,7 @@ en:
subject: 'Daily project summary for %{date} - %{number} updates'
updated: 'Updated'
updated_at: '%{timestamp} ago by %{user}'
logo_alt_text: 'OpenProject Logo'
mail_body_account_activation_request: "A new user (%{value}) has registered. The account is pending your approval:"
mail_body_account_information: "Your account information"

Loading…
Cancel
Save