Skip to content

Commit 40b1f64

Browse files
committed
Add document in mailer
1 parent 36efba0 commit 40b1f64

File tree

1 file changed

+13
-0
lines changed
  • actionmailer/lib/action_mailer

1 file changed

+13
-0
lines changed

actionmailer/lib/action_mailer/base.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,19 @@ module ActionMailer
208208
# end
209209
# end
210210
#
211+
# You can also send attachments with html template, in this case you need to add body, attachments,
212+
# and custom content type like this:
213+
#
214+
# class NotifierMailer < ApplicationMailer
215+
# def welcome(recipient)
216+
# attachments['free_book.pdf'] = File.read('path/to/file.pdf')
217+
# mail(to: recipient,
218+
# subject: "New account information",
219+
# content_type: "text/html",
220+
# body: "<html><body>Hello there</body></html>")
221+
# end
222+
# end
223+
#
211224
# = Inline Attachments
212225
#
213226
# You can also specify that a file should be displayed inline with other HTML. This is useful

0 commit comments

Comments
 (0)