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

Create shared_work_package mailer header

Aaron Contreras160223740599
diff --git a/app/assets/images/icon_logo.png b/app/assets/images/icon_logo.png
new file mode 100644
index 00000000000..b3afa1faeb4
Binary files /dev/null and b/app/assets/images/icon_logo.png differ
diff --git a/app/mailers/sharing_mailer.rb b/app/mailers/sharing_mailer.rb
index 4ea29e2ec1e..b4eddad3a26 100644
--- a/app/mailers/sharing_mailer.rb
+++ b/app/mailers/sharing_mailer.rb
@@ -1,14 +1,16 @@
# frozen_string_literal: true
class SharingMailer < ApplicationMailer
+ helper :mail_notification
+
def shared_work_package(_sharer, membership)
- work_package = membership.entity
+ @work_package = membership.entity
recipient = membership.principal
with_locale_for(recipient) do
mail to: recipient.mail,
subject: I18n.t('mail.sharing.work_packages.subject',
- id: work_package.id)
+ id: @work_package.id)
end
end
end
diff --git a/app/views/sharing_mailer/_notification_mailer_header.html.erb b/app/views/sharing_mailer/_notification_mailer_header.html.erb
new file mode 100644
index 00000000000..880fe97da2f
--- /dev/null
+++ b/app/views/sharing_mailer/_notification_mailer_header.html.erb
@@ -0,0 +1,60 @@
+<!-- TODO: Remove development background set below -->
+<table <%= placeholder_table_styles(width:'100%',style: "background-color:green;width:100%;min-width:100%") %>>
+ <tr>
+ <td>
+ <!-- TODO: Remove development background set below -->
+ <table <%= placeholder_table_styles(style: 'background-color:lightblue;') %>>
+ <tr>
+ <td>
+ <!-- Content -->
+ <!--Start headline -->
+ <!-- TODO: Remove development background set below -->
+ <table <%= placeholder_table_styles(width:'100%',style: "width:100%;background-color:orange;") %>>
+ <tr>
+ <td>
+ <table <%= placeholder_table_styles(style: 'font-size:24px;font-weight:bold') %>>
+ <tr>
+ <td style="white-space: nowrap;">
+ <%= headline %>
+ </td>
+ <%= placeholder_cell('4px', vertical: true) %>
+ <td style="color: <%= type_color(work_package.type, '#333333') %>;white-space: nowrap;">
+ <%= work_package.type.to_s.upcase %>
+ </td>
+ <%= placeholder_cell('4px', vertical: true) %>
+ <td width="100%" style="color: #333333;">
+ #<%= work_package.id %>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <%= placeholder_cell('8px', vertical: false) %>
+ </tr>
+ <tr>
+ <td>
+ <span style="font-size:16px; color: #1A67A3; font-weight: bold;">
+ <%= summary %>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <%= placeholder_cell('40px', vertical: false) %>
+ </tr>
+ </table>
+ <!-- End headline -->
+ </td>
+
+ <!-- Logo -->
+ <td>
+ <%= image_tag 'icon_logo.png', style: 'height: 48px;' %>
+ </td>
+
+ <!-- End logo -->
+ <%= placeholder_cell('16px', vertical: true) %>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
diff --git a/app/views/sharing_mailer/shared_work_package.html.erb b/app/views/sharing_mailer/shared_work_package.html.erb
index fa0575d4546..fe34a7826e9 100644
--- a/app/views/sharing_mailer/shared_work_package.html.erb
+++ b/app/views/sharing_mailer/shared_work_package.html.erb
@@ -1,5 +1,20 @@
-<h1>Sharing#shared_work_package</h1>
+<table>
+ <tr style="background-color: orange;">
+ <%= placeholder_cell('20px', vertical: false) %>
+ </tr>
+</table>
-<p>
- <%= @greeting %>, find me in app/views/sharing_mailer/shared_work_package.html.erb
-</p>
+<table <%= placeholder_table_styles(width: '100%', style: 'width:100%;max-width:700px') %>>
+ <tr>
+ <%= placeholder_cell('12px', vertical: true) %>
+ <td>
+ <%= render partial: 'sharing_mailer/notification_mailer_header',
+ locals: {
+ headline: I18n.t('mail.sharing.work_packages.headline'),
+ summary: I18n.t('mail.sharing.work_packages.summary'),
+ work_package: @work_package
+ } %>
+ </td>
+ <%= placeholder_cell('12px', vertical: true) %>
+ </tr>
+</table>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 97f0fc7b7c2..ac37f0b4638 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -2257,6 +2257,8 @@ en:
sharing:
work_packages:
subject: 'You have been shared work package #%{id}'
+ headline: 'Invitation to'
+ summary: 'This work package has been shared with you'
mail_body_account_activation_request: "A new user (%{value}) has registered. The account is pending your approval:"