diff options
author | MQuy <sugiacupit@gmail.com> | 2016-12-06 10:13:54 +0800 |
---|---|---|
committer | MQuy <sugiacupit@gmail.com> | 2016-12-06 13:47:51 +0800 |
commit | 40b1f648b949f4ad944024619e546765e3729776 (patch) | |
tree | c5bfa584c1b1feae4f1ea4f0a56a0876e8d94693 | |
parent | 36efba05206aef9e587cb971a67d931cd941b90a (diff) | |
download | rails-40b1f648b949f4ad944024619e546765e3729776.tar.gz rails-40b1f648b949f4ad944024619e546765e3729776.tar.bz2 rails-40b1f648b949f4ad944024619e546765e3729776.zip |
Add document in mailer
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 2cb5c5514d..a7015b1e6d 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -208,6 +208,19 @@ module ActionMailer # end # end # + # You can also send attachments with html template, in this case you need to add body, attachments, + # and custom content type like this: + # + # class NotifierMailer < ApplicationMailer + # def welcome(recipient) + # attachments['free_book.pdf'] = File.read('path/to/file.pdf') + # mail(to: recipient, + # subject: "New account information", + # content_type: "text/html", + # body: "<html><body>Hello there</body></html>") + # end + # end + # # = Inline Attachments # # You can also specify that a file should be displayed inline with other HTML. This is useful |