Class: MailerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/mailpy/mailer_api.rb

Instance Method Summary collapse

Constructor Details

#initialize(mail, options = {}) ⇒ MailerApi

Returns a new instance of MailerApi.



4
5
6
7
# File 'lib/mailpy/mailer_api.rb', line 4

def initialize(mail, options = {})
  @mail = mail
  @options = options
end

Instance Method Details

#sendObject



9
10
11
12
13
14
15
# File 'lib/mailpy/mailer_api.rb', line 9

def send
  result = HTTParty.post(
    options[:endpoint],
    body: form_data,
    headers: headers
  )
end