Class: MailchimpSes
- Inherits:
-
MonsterMash::Base
- Object
- MonsterMash::Base
- MailchimpSes
- Defined in:
- lib/mailchimp_ses.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :autogen_html => true }
- OPTIONAL_MESSAGE_FIELDS =
[:to_name, :reply_to, :cc_email, :cc_name, :bcc_email, :bcc_name]
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
Class Method Summary collapse
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
12 13 14 |
# File 'lib/mailchimp_ses.rb', line 12 def api_key @api_key end |
Class Method Details
.parse_message_options(message_options) ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/mailchimp_ses.rb', line 55 def self.() = { :html => extract_param(, :html), :text => [:text], :subject => extract_param(, :subject), :from_name => extract_param(, :from_name), :from_email => extract_param(, :from_email), :to_email => convert_to_hash_array(extract_param(, :to_email)) } OPTIONAL_MESSAGE_FIELDS.each do |field| set_optional_field!(, , field) end # Check lengths of arrays. check_recipients!(, :to_email, :to_name) check_recipients!(, :cc_email, :cc_name) check_recipients!(, :bcc_email, :bcc_name) end |
.parse_options(options) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/mailchimp_ses.rb', line 36 def self.() = DEFAULT_OPTIONS.merge() # Handle tags. = nil if [:tags] && [:tags].size > 0 = convert_to_hash_array([:tags]) end { :message => ([:message]), :track_opens => extract_param(, :track_opens).to_s, :track_clicks => extract_param(, :track_clicks).to_s, :autogen_html => extract_param(, :autogen_html).to_s, :tags => } end |