diff --git a/lib/email/sender.rb b/lib/email/sender.rb index 02738081e86..d19bd65e58a 100644 --- a/lib/email/sender.rb +++ b/lib/email/sender.rb @@ -253,7 +253,7 @@ module Email if post.present? @stripped_secure_upload_shas = style.stripped_upload_sha_map.values add_attachments(post) - elsif @email_type == :digest + elsif @email_type.to_s == "digest" @stripped_secure_upload_shas = style.stripped_upload_sha_map.values digest_posts.each { |p| add_attachments(p) } end diff --git a/spec/lib/email/sender_spec.rb b/spec/lib/email/sender_spec.rb index 91a633dc259..bb412a5176c 100644 --- a/spec/lib/email/sender_spec.rb +++ b/spec/lib/email/sender_spec.rb @@ -659,7 +659,7 @@ RSpec.describe Email::Sender do message.header["X-Discourse-Post-Id"] = nil message.header["X-Discourse-Post-Ids"] = "#{reply.id},#{other_post.id}" - Email::Sender.new(message, :digest).send + Email::Sender.new(message, "digest").send expect(message.attachments.map(&:filename)).to include( *[image, @secure_image, @secure_image_2].map(&:original_filename), )