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.
250 251 252 |
# File 'lib/mailchimp/api.rb', line 250 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
248 249 250 |
# File 'lib/mailchimp/api.rb', line 248 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.
332 333 334 335 |
# File 'lib/mailchimp/api.rb', line 332 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
350 351 352 353 |
# File 'lib/mailchimp/api.rb', line 350 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.
363 364 365 366 |
# File 'lib/mailchimp/api.rb', line 363 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.
379 380 381 382 |
# File 'lib/mailchimp/api.rb', line 379 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.
389 390 391 392 |
# File 'lib/mailchimp/api.rb', line 389 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.
403 404 405 406 |
# File 'lib/mailchimp/api.rb', line 403 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.
411 412 413 414 |
# File 'lib/mailchimp/api.rb', line 411 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
427 428 429 430 |
# File 'lib/mailchimp/api.rb', line 427 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
443 444 445 446 |
# File 'lib/mailchimp/api.rb', line 443 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
453 454 455 456 |
# File 'lib/mailchimp/api.rb', line 453 def verified_domains() _params = {} return @master.call 'helper/verified-domains', _params end |