Filename for add_attachment is not being set properly
Hi,
I am currently using v1.3.3 and when using MessageBuilder object and adding an attachment, the filename given is not being used.
mb_obj = Mailgun::MessageBuilder.new
mb_obj.add_attachment "#{Rails.root}/x/x/files/offer_letter_sample.docx", "Receipt.docx"
Here is the resulting MessageBuilder object where the original_filename seems to be overwritten by the filename from the io or local_path instead of using the Receipt.docx name given
:attachment=>
[#<UploadIO:0x0000000115bf5250
@content_type=
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
@io=
#<File:/Users/x/x/x/x/x/x/files/offer_letter_sample.docx>,
@local_path=
"/Users/x/x/x/x/x/x/files/offer_letter_sample.docx",
@opts={},
@original_filename="offer_letter_sample.docx">,
Not sure if this is related to the fix in https://github.com/mailgun/mailgun-ruby/releases/tag/v1.3.3
Let me know if theres anything else I can do to help
I would add that the Rails ActionMailer integration should also be considered as mails with attachments don't seem to set the name properly either.
@matthewgani the issue is fixed in https://github.com/mailgun/mailgun-ruby/releases/tag/v1.3.5 Please check if it works for you. Thanks.
@tttffff Thank you for the fix! @alex-leb it works as expected now, thanks!