Class: MailHandler::Sending::PostmarkAPISender

Inherits:
MailHandler::Sender show all
Defined in:
lib/mailhandler/sending/api.rb

Direct Known Subclasses

PostmarkBatchAPISender

Instance Attribute Summary collapse

Attributes inherited from MailHandler::Sender

#dispatcher, #sending

Instance Method Summary collapse

Methods inherited from MailHandler::Sender

#send_email

Constructor Details

#initialize(api_token = nil) ⇒ PostmarkAPISender

Returns a new instance of PostmarkAPISender.



15
16
17
18
19
20
21
22
# File 'lib/mailhandler/sending/api.rb', line 15

def initialize(api_token = nil)

  @type = :postmark_api
  @host = DEFAULT_HOST
  @api_token = api_token
  @use_ssl = false

end

Instance Attribute Details

#api_tokenObject

Returns the value of attribute api_token.



11
12
13
# File 'lib/mailhandler/sending/api.rb', line 11

def api_token
  @api_token
end

#hostObject

Returns the value of attribute host.



11
12
13
# File 'lib/mailhandler/sending/api.rb', line 11

def host
  @host
end

#use_sslObject

Returns the value of attribute use_ssl.



11
12
13
# File 'lib/mailhandler/sending/api.rb', line 11

def use_ssl
  @use_ssl
end

Instance Method Details

#send(email) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/mailhandler/sending/api.rb', line 24

def send(email)

  verify_email(email)

  client = setup_sending_client
  client.deliver_message(email)

end