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.
237 238 239 |
# File 'lib/mailchimp/api.rb', line 237 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
235 236 237 |
# File 'lib/mailchimp/api.rb', line 235 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.
319 320 321 322 |
# File 'lib/mailchimp/api.rb', line 319 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
337 338 339 340 |
# File 'lib/mailchimp/api.rb', line 337 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.
350 351 352 353 |
# File 'lib/mailchimp/api.rb', line 350 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.
366 367 368 369 |
# File 'lib/mailchimp/api.rb', line 366 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.
376 377 378 379 |
# File 'lib/mailchimp/api.rb', line 376 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.
390 391 392 393 |
# File 'lib/mailchimp/api.rb', line 390 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.
398 399 400 401 |
# File 'lib/mailchimp/api.rb', line 398 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
414 415 416 417 |
# File 'lib/mailchimp/api.rb', line 414 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
430 431 432 433 |
# File 'lib/mailchimp/api.rb', line 430 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
440 441 442 443 |
# File 'lib/mailchimp/api.rb', line 440 def verified_domains() _params = {} return @master.call 'helper/verified-domains', _params end |