diff --git a/app/views/digest_mailer/work_packages.html.erb b/app/views/digest_mailer/work_packages.html.erb index 802f6f887ac4..32965e9394de 100644 --- a/app/views/digest_mailer/work_packages.html.erb +++ b/app/views/digest_mailer/work_packages.html.erb @@ -60,7 +60,7 @@ >
- <%= I18n.t(:'mail.work_packages.see_all') %> diff --git a/app/workers/mails/reminder_job.rb b/app/workers/mails/reminder_job.rb index 01e84db4ea28..bbc6eaba109e 100644 --- a/app/workers/mails/reminder_job.rb +++ b/app/workers/mails/reminder_job.rb @@ -32,7 +32,11 @@ class Mails::ReminderJob < Mails::DeliverJob good_job_control_concurrency_with( total_limit: 1, - key: -> { "#{self.class.name}-#{arguments.last}" } + key: -> do + id = arguments.last.respond_to?(:id) ? arguments.last.id : arguments.last + + "#{self.class.name}-#{id}" + end ) private diff --git a/spec/mailers/digest_mailer_spec.rb b/spec/mailers/digest_mailer_spec.rb index 6b6b4d9fba2d..4dabc26717c4 100644 --- a/spec/mailers/digest_mailer_spec.rb +++ b/spec/mailers/digest_mailer_spec.rb @@ -120,6 +120,16 @@ .to have_text(expected_text, normalize_ws: true) end + it "includes a reference to the notification center if there are more than the maximum number of shown work packages" do + stub_const("DigestMailer::MAX_SHOWN_WORK_PACKAGES", 0) + + expect(mail_body) + .to have_text I18n.t(:"mail.work_packages.more_to_see.one") + + expect(mail_body) + .to have_link(I18n.t(:"mail.work_packages.see_all"), href: notifications_url) + end + context "with only a deleted work package for the digest" do let(:work_package) { nil }