Module: Chimpster
- Defined in:
- lib/chimpster.rb,
lib/chimpster/message_extensions/shared.rb
Defined Under Namespace
Modules: SharedMessageExtensions
Constant Summary collapse
- MAX_RETRIES =
2
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.from ⇒ Object
Returns the value of attribute from.
-
.logger ⇒ Object
Returns the value of attribute logger.
-
.max_retries ⇒ Object
Returns the value of attribute max_retries.
-
.sleep_between_retries ⇒ Object
Returns the value of attribute sleep_between_retries.
-
.to ⇒ Object
Returns the value of attribute to.
-
.uakari ⇒ Object
Returns the value of attribute uakari.
Class Method Summary collapse
- .configure {|_self| ... } ⇒ Object
- .send(message) ⇒ Object
-
.send_through_chimpster(message) ⇒ Object
:nodoc:.
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
15 16 17 |
# File 'lib/chimpster.rb', line 15 def api_key @api_key end |
.from ⇒ Object
Returns the value of attribute from.
15 16 17 |
# File 'lib/chimpster.rb', line 15 def from @from end |
.logger ⇒ Object
Returns the value of attribute logger.
15 16 17 |
# File 'lib/chimpster.rb', line 15 def logger @logger end |
.max_retries ⇒ Object
Returns the value of attribute max_retries.
15 16 17 |
# File 'lib/chimpster.rb', line 15 def max_retries @max_retries end |
.sleep_between_retries ⇒ Object
Returns the value of attribute sleep_between_retries.
15 16 17 |
# File 'lib/chimpster.rb', line 15 def sleep_between_retries @sleep_between_retries end |
.to ⇒ Object
Returns the value of attribute to.
15 16 17 |
# File 'lib/chimpster.rb', line 15 def to @to end |
.uakari ⇒ Object
Returns the value of attribute uakari.
15 16 17 |
# File 'lib/chimpster.rb', line 15 def uakari @uakari end |
Class Method Details
.configure {|_self| ... } ⇒ Object
29 30 31 |
# File 'lib/chimpster.rb', line 29 def configure yield self end |
.send(message) ⇒ Object
33 34 35 36 37 |
# File 'lib/chimpster.rb', line 33 def send () response = @uakari.send_email() response end |
.send_through_chimpster(message) ⇒ Object
:nodoc:
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/chimpster.rb', line 39 def send_through_chimpster() #:nodoc: puts 'sending email' @retries = 0 _from = ['from'].to_s _from = @from unless @from == nil _to =['to'].to_s _to = @to unless @to == nil _html = .body_html _text = .body_text = { :text => _text, :html => _html, :subject => .subject, :from_email => _from, :to_email => _to.split(','), :reply_to => _from.split(',') } response = self.send({ :track_opens => true, :track_clicks => true, :message => , :tags => (.tag.to_s if .tag) }) c=response['status'] v= ['queued','sent'].include?(c) if v == false logger.info "ERROR Sending Email via Chimpster #{response.to_s}" else logger.info "Email Sent via Chimpster #{response.to_s}" end v end |