Finally am able to find the actual cause of above issue.
I am using the gem postmark-rails, previously postmark was not supporting the email-attachments, so recently they had enhanced gem to support attachments and unfortunately i was using the old version of it, so i need to update gem version to latest as they have mentioned in one of their issues: attachment-issue
also i was trying to send url of file saved on S3, so instead of that i need to read that file from url and then send it as attachment
require "open-uri"
def send_refer_pt_request(params, attachment)
if attachment.present?
mime_type = MIME::Types.type_for(attachment).first
url_data = open(attachment).read()
attachments["#{attachment.split('/').last}"] = { mime_type: mime_type,
content: url_data }
end
mail(
to: <some_email>,
subject: "Refer Request",
tag: "refer_request")
end