Project

General

Profile

Actions

Defect #18181

closed

Cannot send custom mail notifications with attachments

Added by Alex Antropoff over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email notifications
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Invalid
Affected version:

Description

Good day!

Sorry, I don't know which tracker should I choose to publish my question. I think this is not Redmine's bug, but my mistake.
Sorry for my bad English too :)

I have some custom email templates (one (pair) of them is in attachment to the Issue) and extended mailer.rb: in issue_edit() I try to send specific email-notifications to users with the specific role (is_support?(project)). I do this before native mailing (see mailer.rb issue_edit() function). I need to include attachments to my custom notifications, not links - just files in email (attachments[fnam] = File.read(full, mode: 'rb') on Windows OS)
). So, native notifications are sending with no problems - there are all file attachments of any types (jpg/zip/pdf/doc/etc...), but my custom notifications have no any attachment.

I opened the email original in GMail and saw that there were differencies in content types. Normal (with attachments) has content_type 'multipartial/mixed', but my custom letter has content_type 'multipart/alternative'.
I've tried to pass content_type in mailer.rb code, but it corrupts the letter at all.

Please, can you give me an advice or an example of working code.

Thanks!


Files

mailer.rb (31.1 KB) mailer.rb my mailer.rb Alex Antropoff, 2014-10-24 14:31
support_note.html.erb (152 Bytes) support_note.html.erb custom template (html) Alex Antropoff, 2014-10-24 14:32
support_note.text.erb (111 Bytes) support_note.text.erb custom template (text) Alex Antropoff, 2014-10-24 14:32
Actions

Also available in: Atom PDF