-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version 1.3.x breaks sending simple text/csv attachments #340
Comments
One additional note, we have a unit test that did not fail with this upgrade, so whatever is causing this breakage appears to be triggered in the actual delivery process and not in the compilation of the email object that fires in the test environment: RSpec.describe AnalyticsReportMailer, type: :mailer do
let(:mail) { AnalyticsReportMailer.nightly_user_count }
before do
Time.zone = 'UTC'
Timecop.freeze(Time.zone.parse('2017-10-11 03:00:00'))
end
after do
Timecop.return
end
describe 'nightly_user_count' do
it 'renders the headers' do
...
end
it 'renders the html text body' do
...
end
it 'renders the appropriate attachments' do
str_date = 'October 9'
title1 = "User counts as of #{str_date} at 11:59 PM EDT.csv"
title2 = "User sessions as of #{str_date} at 11:59 PM EDT.csv"
title3 = "Lead counts as of #{str_date} at 11:59 PM EDT.csv"
expect(mail.attachments.count).to eq 3
attachment1 = mail.attachments.first
expect(attachment1.content_type).to start_with('text/csv')
expect(attachment1.filename).to eq title1
attachment2 = mail.attachments.second
expect(attachment2.content_type).to start_with('text/csv')
expect(attachment2.filename).to eq title2
attachment3 = mail.attachments.last
expect(attachment3.content_type).to start_with('text/csv')
expect(attachment3.filename).to eq title3
end
end
end |
I faced the same issue after the upgrade to 1.3.2 😅. Unit tests for my mailers were also passing too 🤷🏻. |
Confirming this breaks ActionMailer on my Rails 7 app as well |
Can confirm it broke here on Rails |
Yep, same here |
I have a Rails 7 app where one of the mailers includes a few CSV attachments. This mailer has been working as-is for several years. Yesterday I upgraded mailgun-ruby 1.2.16 -> 1.3.2 (along with several other gems) and this morning the email did not include any attachments. I reverted just the mailgun-ruby gem to 1.2.16 and now the emails include the attachments. Here is the affected mailer code that has been working fine with the older versions of this gem:
As soon as I upgrade to mailgun-ruby v1.3.2 again, the email no longer contains attachments again. I've done this a few times now with consistent results. Here's the only change in my working directory:
Obviously I can't provide the full source of the generated email here. Is there any other info you need to resolve this bug?
The text was updated successfully, but these errors were encountered: