Public Class methods
If this is an email request, set the mail object in the response, as well as the default content_type for the email.
# File lib/roda/plugins/mailer.rb 239 def initialize(env) 240 super 241 if mail = env['roda.mail'] 242 res = @_response 243 res.mail = mail 244 res.headers.delete(RodaResponseHeaders::CONTENT_TYPE) 245 end 246 end
Public Instance methods
Delay adding a file to the message until after the message body has been set. If a block is given, the block is called after the file has been added, and you can access the attachment via
# File lib/roda/plugins/mailer.rb 251 def add_file(*a, &block) 252 response.mail_attachments << [a, block] 253 nil 254 end
Signal that no mail should be sent for this request.
# File lib/roda/plugins/mailer.rb 257 def no_mail! 258 throw :no_mail 259 end