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

Change subject string (maybe changed later)

Henriette Darge49725ccc7631
diff --git a/app/mailers/digest_mailer.rb b/app/mailers/digest_mailer.rb
index 6648f6a3be6..9c071553100 100644
--- a/app/mailers/digest_mailer.rb
+++ b/app/mailers/digest_mailer.rb
@@ -69,8 +69,9 @@ class DigestMailer < ApplicationMailer
with_locale_for(recipient) do
mail to: recipient.mail,
subject: I18n.t('mail.digests.work_packages.subject',
- date: format_time_as_date(Time.current),
- number: notification_ids.count)
+ instance_name: Setting.app_title,
+ notifications: notification_ids.count,
+ work_packages: @aggregated_notifications.count)
end
end
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 9248ddd8f55..56c997581b9 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1983,10 +1983,10 @@ en:
subscribed: 'all'
prefix: 'Received because of the notification setting: %{reason}'
see_all: 'See all'
- subject: 'Daily project summary for %{date} - %{number} updates'
+ subject: '%{instance_name} - %{notifications} unread notification(s) in %{work_packages} work package(s)'
updated: 'Updated'
updated_at: '%{timestamp} ago by %{user}'
- logo_alt_text: 'OpenProject Logo'
+ logo_alt_text: 'Logo'
notification:
center: 'Notification center'
settings: 'Change email settings'
diff --git a/spec/features/notifications/digest_mail_spec.rb b/spec/features/notifications/digest_mail_spec.rb
index 50ac533594a..ef734f21297 100644
--- a/spec/features/notifications/digest_mail_spec.rb
+++ b/spec/features/notifications/digest_mail_spec.rb
@@ -133,7 +133,8 @@ describe "Digest email", type: :feature, js: true do
expect(ActionMailer::Base.deliveries.first.subject)
.to eql I18n.t(:'mail.digests.work_packages.subject',
- date: Time.current.strftime('%m/%d/%Y'),
- number: 1)
+ instance_name: Setting.app_title,
+ notifications: 1,
+ work_packages: 1)
end
end
diff --git a/spec/mailers/digest_mailer_spec.rb b/spec/mailers/digest_mailer_spec.rb
index 7eb2eb01822..151af2d60d3 100644
--- a/spec/mailers/digest_mailer_spec.rb
+++ b/spec/mailers/digest_mailer_spec.rb
@@ -76,13 +76,14 @@ describe DigestMailer, type: :mailer do
describe '#work_packages' do
subject(:mail) { described_class.work_packages(recipient.id, notifications.map(&:id)) }
- let(:mail_body) { mail.body.encoded }
+ let(:mail_body) { mail.body.parts.detect { |part| part['Content-Type'].value == 'text/html' }.body.to_s }
it 'notes the day and the number of notifications in the subject' do
expect(mail.subject)
.to eql I18n.t('mail.digests.work_packages.subject',
- date: format_time_as_date(Time.current),
- number: 1)
+ instance_name: Setting.app_title,
+ notifications: 1,
+ work_packages: 1)
end
it 'sends to the recipient' do