Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Show correct button with individual link in each email

Henriette Darge9ac05a293b98
diff --git a/app/views/digest_mailer/work_packages.html.erb b/app/views/digest_mailer/work_packages.html.erb
index 19deb981e49..aa93f13d0aa 100644
--- a/app/views/digest_mailer/work_packages.html.erb
+++ b/app/views/digest_mailer/work_packages.html.erb
@@ -7,10 +7,16 @@
<table <%= placeholder_table_styles(width:'100%',style: 'width:100%;max-width:700px;margin-left:auto;margin-right:auto') %>>
<tr>
<td>
- <%= render partial: 'mailer/notification_mailer_header',
+ <%= render layout: 'mailer/notification_mailer_header',
locals: {
summary: "#{I18n.t(:'mail.digests.you_have')} #{digest_summary_text(@notification_ids.length, @mentioned_count)}"
- } %>
+ } do %>
+ <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;font-size: 14px;">
+ <%= I18n.t(:'mail.notification.center') %>
+ </a>
+ <% end %>
<% @aggregated_notifications.first(DigestMailer::MAX_SHOWN_WORK_PACKAGES).each do | work_package, notifications_by_work_package| %>
<%= render layout: 'mailer/notification_row',
diff --git a/app/views/mailer/_notification_mailer_header.html.erb b/app/views/mailer/_notification_mailer_header.html.erb
index d8a2817843e..9262e55ab25 100644
--- a/app/views/mailer/_notification_mailer_header.html.erb
+++ b/app/views/mailer/_notification_mailer_header.html.erb
@@ -28,11 +28,7 @@
</tr>
<tr>
<td>
- <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;font-size: 14px;">
- <%= I18n.t(:'mail.notification.center') %>
- </a>
+ <%= yield %>
</td>
</tr>
<tr>
@@ -54,4 +50,4 @@
</table>
</td>
</tr>
-</table>
\ No newline at end of file
+</table>
diff --git a/app/views/work_package_mailer/mentioned.html.erb b/app/views/work_package_mailer/mentioned.html.erb
index f7fef588111..13095bec5ea 100644
--- a/app/views/work_package_mailer/mentioned.html.erb
+++ b/app/views/work_package_mailer/mentioned.html.erb
@@ -7,10 +7,16 @@
<table <%= placeholder_table_styles(width:'100%',style: 'width:100%;max-width:700px;margin-left:auto;margin-right:auto') %>>
<tr>
<td>
- <%= render partial: 'mailer/notification_mailer_header',
+ <%= render layout: 'mailer/notification_mailer_header',
locals: {
summary: "#{I18n.t(:'mail.work_packages.mentioned_by', user: @journal.user)}"
- } %>
+ } do %>
+ <a href="<%= notifications_path(@work_package.id) %>"
+ target="_blank"
+ style="background: #D1E5F5; padding: 8px 12px; color: #1A67A3; border: 1px solid #1A67A3; border-radius: 16px; text-decoration: none;font-size: 14px;">
+ <%= I18n.t(:'mail.notification.see_in_center') %>
+ </a>
+ <% end %>
<%= render layout: 'mailer/notification_row',
locals: {
diff --git a/config/locales/en.yml b/config/locales/en.yml
index d8d68579dac..d552c4d832c 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1979,6 +1979,7 @@ en:
subject: "%{user_name} mentioned you in #%{id} - %{subject}"
notification:
center: 'To notification center'
+ see_in_center: 'See comment in notification center'
settings: 'Change email settings'
salutation: 'Hey %{user}!'
work_packages: