Class: DynamicFormMailer
- Inherits:
-
ActionMailer::Base
- Object
- ActionMailer::Base
- DynamicFormMailer
- Defined in:
- app/mailers/dynamic_form_mailer.rb
Instance Method Summary collapse
-
#widget_email_with_attachments(form, dynamicObject, subject = '', files = []) ⇒ Object
uses mail_alternatives_with_attachments gem ActionMailer doesn’t handle attachments well without this gem.
Instance Method Details
#widget_email_with_attachments(form, dynamicObject, subject = '', files = []) ⇒ Object
uses mail_alternatives_with_attachments gem ActionMailer doesn’t handle attachments well without this gem
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/mailers/dynamic_form_mailer.rb', line 16 def (form, dynamicObject, subject='', files=[]) = dynamicObject.form. rescue [] @dynamicData = dynamicObject.data.(, true) subject = "#{model_name} Submission" if subject.blank? = to: form., from: ErpTechSvcs::Config.email_notifications_from, subject: subject, :content_type => "multipart/mixed" .( :text => render_to_string(:template => "dynamic_form_mailer/widget_email_with_attachments.text"), :html => render_to_string(:template => "dynamic_form_mailer/widget_email_with_attachments.html") ) do || files.each do |f| .inline[f.original_filename] = f.tempfile.read end end end |