Class: MetaMailer::Jangomail
- Inherits:
-
MetaMailer
- Object
- MetaMailer
- MetaMailer::Jangomail
- Defined in:
- lib/jangomailm.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(username, password) ⇒ Jangomail
constructor
A new instance of Jangomail.
- #send(from, to, subject, html, text) ⇒ Object
Methods inherited from MetaMailer
Constructor Details
#initialize(username, password) ⇒ Jangomail
Returns a new instance of Jangomail.
7 8 9 10 |
# File 'lib/jangomailm.rb', line 7 def initialize(username, password) @username = username @password = password end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/jangomailm.rb', line 5 def api_key @api_key end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/jangomailm.rb', line 4 def username @username end |
Instance Method Details
#send(from, to, subject, html, text) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/jangomailm.rb', line 12 def send(from, to, subject, html, text) uri = URI("http://api.jangomail.com/api.asmx/SendTransactionalEmail") from_address = from.split("<")[1].split(">")[0] from_name = from.split(" <")[0] p = {:Username => @username, :Password => @password, :FromEmail => from_address, :FromName => from_name, :ToEmailAddress => to, :Subject => subject, :MessagePlain => text, :MessageHTML => html, :Options => ""} response = Net::HTTP.post_form(uri, p) end |