module Roda::RodaPlugins::Mailer::ClassMethods
def mail(path, *args)
and arguments. You can further manipulate the returned mail object before
Return a Mail::Message instance for the email for the given request path
def mail(path, *args) mail = ::Mail.new catch(:no_mail) do unless mail.equal?(new("PATH_INFO"=>path, 'SCRIPT_NAME'=>'', "REQUEST_METHOD"=>"MAIL", 'rack.input'=>StringIO.new, 'roda.mail'=>mail, 'roda.mail_args'=>args).call(&route_block)) raise Error, "route did not return mail instance for #{path.inspect}, #{args.inspect}" end mail end end
def sendmail(*args)
def sendmail(*args) if m = mail(*args) m.deliver end end