Class: Venn::EmailClient
- Inherits:
-
Object
- Object
- Venn::EmailClient
- Defined in:
- lib/venn/email_client.rb
Instance Method Summary collapse
-
#initialize(api_key) ⇒ EmailClient
constructor
A new instance of EmailClient.
- #send(from, to, subject, message) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ EmailClient
Returns a new instance of EmailClient.
4 5 6 7 8 9 |
# File 'lib/venn/email_client.rb', line 4 def initialize(api_key) @services = {} @venn_client = Venn::Services::Api.new :api_key => api_key @keys = @venn_client.get_keys configure_services @keys end |
Instance Method Details
#send(from, to, subject, message) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/venn/email_client.rb', line 11 def send(from, to, subject, ) sent_with = '' sorted_services.each do |service| begin sent_with = service.send from, to, subject, break rescue Exception => e puts e. end end sent_with end |