Last active
December 13, 2015 23:38
-
-
Save starrhorne/4992593 to your computer and use it in GitHub Desktop.
Example of how to use the Incoming! gem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First, you define an email receiver class | |
class EmailReceiver < Incoming::Strategies::CloudMailin | |
def receive(mail) | |
puts %(Got message from #{mail.to.first} with subject "#{mail.subject}") | |
end | |
end | |
# Then you feed it a Rack::Request object. And you're done. | |
req = Rack::Request.new(env) | |
result = EmailReceiver.receive(req) # => Got message from [email protected] with subject "hello world" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment