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.
248 249 250 |
# File 'lib/mailchimp/api.rb', line 248 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
246 247 248 |
# File 'lib/mailchimp/api.rb', line 246 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.
330 331 332 333 |
# File 'lib/mailchimp/api.rb', line 330 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
348 349 350 351 |
# File 'lib/mailchimp/api.rb', line 348 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.
361 362 363 364 |
# File 'lib/mailchimp/api.rb', line 361 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 <strong>not</strong> 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.
377 378 379 380 |
# File 'lib/mailchimp/api.rb', line 377 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.
387 388 389 390 |
# File 'lib/mailchimp/api.rb', line 387 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.
401 402 403 404 |
# File 'lib/mailchimp/api.rb', line 401 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.
409 410 411 412 |
# File 'lib/mailchimp/api.rb', line 409 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
424 425 426 427 |
# File 'lib/mailchimp/api.rb', line 424 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
440 441 442 443 |
# File 'lib/mailchimp/api.rb', line 440 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
450 451 452 453 |
# File 'lib/mailchimp/api.rb', line 450 def verified_domains() _params = {} return @master.call 'helper/verified-domains', _params end |