Class: Mailchimp::Helper
- Inherits:
-
Object
- Object
- Mailchimp::Helper
- Defined in:
- lib/mailchimp/api.rb
Instance Attribute Summary collapse
-
#master ⇒ Object
Returns the value of attribute master.
Instance Method Summary collapse
-
#account_details(exclude = []) ⇒ Hash
Retrieve lots of account information including payments made, plan info, some account stats, installed modules, contact info, and more.
-
#campaigns_for_email(email, options = nil) ⇒ Array
Retrieve minimal data for all Campaigns a member was sent.
-
#chimp_chatter ⇒ Array
Return the current Chimp Chatter messages for an account.
-
#generate_text(type, content) ⇒ Hash
Have HTML content auto-converted to a text-only format.
-
#initialize(master) ⇒ Helper
constructor
A new instance of Helper.
-
#inline_css(html, strip_css = false) ⇒ Hash
Send your HTML content to have the CSS inlined and optionally remove the original styles.
-
#lists_for_email(email) ⇒ Array
Retrieve minimal List data for all lists a member is subscribed to.
-
#ping ⇒ Hash
"Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good.
-
#search_campaigns(query, offset = 0, snip_start = nil, snip_end = nil) ⇒ Hash
Search all campaigns for the specified query terms.
-
#search_members(query, id = nil, offset = 0) ⇒ Hash
Search account wide or on a specific list using the specified query terms.
-
#verified_domains ⇒ Array
Retrieve all domain verification records for an account.
Constructor Details
#initialize(master) ⇒ Helper
Returns a new instance of Helper.
236 237 238 |
# File 'lib/mailchimp/api.rb', line 236 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
234 235 236 |
# File 'lib/mailchimp/api.rb', line 234 def master @master end |
Instance Method Details
#account_details(exclude = []) ⇒ Hash
Retrieve lots of account information including payments made, plan info, some account stats, installed modules, contact info, and more. No private information like Credit Card numbers is available.
318 319 320 321 |
# File 'lib/mailchimp/api.rb', line 318 def account_details(exclude=[]) _params = {:exclude => exclude} return @master.call 'helper/account-details', _params end |
#campaigns_for_email(email, options = nil) ⇒ Array
Retrieve minimal data for all Campaigns a member was sent
336 337 338 339 |
# File 'lib/mailchimp/api.rb', line 336 def campaigns_for_email(email, =nil) _params = {:email => email, :options => } return @master.call 'helper/campaigns-for-email', _params end |
#chimp_chatter ⇒ Array
Return the current Chimp Chatter messages for an account.
349 350 351 352 |
# File 'lib/mailchimp/api.rb', line 349 def chimp_chatter() _params = {} return @master.call 'helper/chimp-chatter', _params end |
#generate_text(type, content) ⇒ Hash
Have HTML content auto-converted to a text-only format. You can send: plain HTML, an existing Campaign Id, or an existing Template Id. Note that this will not save anything to or update any of your lists, campaigns, or templates. It's also not just Lynx and is very fine tuned for our template layouts - your mileage may vary.
365 366 367 368 |
# File 'lib/mailchimp/api.rb', line 365 def generate_text(type, content) _params = {:type => type, :content => content} return @master.call 'helper/generate-text', _params end |
#inline_css(html, strip_css = false) ⇒ Hash
Send your HTML content to have the CSS inlined and optionally remove the original styles.
375 376 377 378 |
# File 'lib/mailchimp/api.rb', line 375 def inline_css(html, strip_css=false) _params = {:html => html, :strip_css => strip_css} return @master.call 'helper/inline-css', _params end |
#lists_for_email(email) ⇒ Array
Retrieve minimal List data for all lists a member is subscribed to.
389 390 391 392 |
# File 'lib/mailchimp/api.rb', line 389 def lists_for_email(email) _params = {:email => email} return @master.call 'helper/lists-for-email', _params end |
#ping ⇒ Hash
"Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply receive a different string back that will explain our view on what is going on.
397 398 399 400 |
# File 'lib/mailchimp/api.rb', line 397 def ping() _params = {} return @master.call 'helper/ping', _params end |
#search_campaigns(query, offset = 0, snip_start = nil, snip_end = nil) ⇒ Hash
Search all campaigns for the specified query terms
413 414 415 416 |
# File 'lib/mailchimp/api.rb', line 413 def search_campaigns(query, offset=0, snip_start=nil, snip_end=nil) _params = {:query => query, :offset => offset, :snip_start => snip_start, :snip_end => snip_end} return @master.call 'helper/search-campaigns', _params end |
#search_members(query, id = nil, offset = 0) ⇒ Hash
Search account wide or on a specific list using the specified query terms
429 430 431 432 |
# File 'lib/mailchimp/api.rb', line 429 def search_members(query, id=nil, offset=0) _params = {:query => query, :id => id, :offset => offset} return @master.call 'helper/search-members', _params end |
#verified_domains ⇒ Array
Retrieve all domain verification records for an account
439 440 441 442 |
# File 'lib/mailchimp/api.rb', line 439 def verified_domains() _params = {} return @master.call 'helper/verified-domains', _params end |