Created
July 28, 2011 19:19
-
-
Save maxwell/1112309 to your computer and use it in GitHub Desktop.
message bus email interceptor wip
This file contains hidden or 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
##register this class as an interceptor | |
##this should be in the message_bus_ruby_api gem, and needs to have configuration, and #map to action mailer in a less dumb way | |
#also, can we prevent action mailer from continuing to do its default config? | |
#no time to dig into it now. | |
require 'message_bus_ruby_api' | |
class MessageBusInterceptor | |
def self.delivering_email(message) | |
client = MessagebusRubyApi::Client.new(MESSAGE_BUS_API_KEY) | |
required_params = { | |
:subject => message.subject | |
:body => message.body | |
:fromEmail => message.from | |
:toEmail => message.to | |
} | |
optional_params = { | |
:fromName => '' | |
:toName => '' | |
:tag => "" | |
} | |
params = required_params.merge(optional_params) | |
client.send_email(params) | |
message | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment