class method
self.receive
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v6.0.6Signature
self.receive(raw_email)
Receives a raw email, parses it into an email object, decodes it, instantiates a new mailer, and passes the email object to the mailer object’s receive method. If you want your mailer to be able to process incoming messages, you’ll need to implement a receive method that accepts the email object as a parameter:
class MyMailer < ActionMailer::Base
def receive(mail)
...
end
end
Parameters
-
raw_emailreq
Source
# File actionmailer/lib/action_mailer/base.rb, line 448
def receive(raw_email)
logger.info "Received mail:\n #{raw_email}" unless logger.nil?
mail = TMail::Mail.parse(raw_email)
mail.base64_decode
new.receive(mail)
end
Defined in actionmailer/lib/action_mailer/base.rb line 448
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionMailer::Base