Class: Venn::Services::SendGrid
- Inherits:
-
Object
- Object
- Venn::Services::SendGrid
- Defined in:
- lib/venn/services/sendgrid.rb
Instance Method Summary collapse
-
#initialize(keys) ⇒ SendGrid
constructor
A new instance of SendGrid.
- #send(from, to, subject, message) ⇒ Object
Constructor Details
#initialize(keys) ⇒ SendGrid
5 6 7 8 9 10 11 |
# File 'lib/venn/services/sendgrid.rb', line 5 def initialize(keys) @name = 'sendgrid' @client = ::SendGrid::Client.new do |c| c.api_user = keys[:api_user] c.api_key = keys[:api_key] end end |
Instance Method Details
#send(from, to, subject, message) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/venn/services/sendgrid.rb', line 13 def send(from, to, subject, ) mail = ::SendGrid::Mail.new do |m| m.to = to m.from = from m.subject = subject m.html = end @client.send mail @name end |