Class: Mailchimp::Vip

Inherits:
Object
  • Object
show all
Defined in:
lib/mailchimp/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Vip

Returns a new instance of Vip.



1683
1684
1685
# File 'lib/mailchimp/api.rb', line 1683

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



1681
1682
1683
# File 'lib/mailchimp/api.rb', line 1681

def master
  @master
end

Instance Method Details

#activityArray

Retrieve all Activity (opens/clicks) for VIPs over the past 10 days

Returns:

  • (Array)

    structs for each activity recorded.

    • String

      action The action taken - either “open” or “click”

    • String

      timestamp The datetime the action occurred in GMT

    • String

      url IF the action is a click, the url that was clicked

    • String

      unique_id The campaign_id of the List the Member appears on

    • String

      title The campaign title

    • String

      list_name The name of the List the Member appears on

    • String

      list_id The id of the List the Member appears on

    • String

      email The email address of the member

    • String

      fname IF a FNAME merge field exists on the list, that value for the member

    • String

      lname IF a LNAME merge field exists on the list, that value for the member

    • Int

      member_rating the rating of the subscriber. This will be 1 - 5 as described <a href=“eepurl.com/f-2P” target=“_blank”>here</a>

    • String

      member_since the datetime the member was added and/or confirmed

    • Hash

      geo the geographic information if we have it. including:

      - [String] latitude the latitude
      - [String] longitude the longitude
      - [String] gmtoff GMT offset
      - [String] dstoff GMT offset during daylight savings (if DST not observered, will be same as gmtoff
      - [String] timezone the timezone we've place them in
      - [String] cc 2 digit ISO-3166 country code
      - [String] region generally state, province, or similar
      


1709
1710
1711
1712
# File 'lib/mailchimp/api.rb', line 1709

def activity()
    _params = {}
    return @master.call 'vip/activity', _params
end

#add(id, emails) ⇒ Hash

Add VIPs (previously called Golden Monkeys)

Parameters:

  • id (String)

    the list id to connect to. Get by calling lists/list()

  • emails (Array)

    an array of up to 50 email address structs to add, each with with one of the following keys

    • String

      email an email address - for new subscribers obviously this should be used

    • String

      euid the unique id for an email address (not list related) - the email “id” returned from listMemberInfo, Webhooks, Campaigns, etc.

    • String

      leid the list email id (previously called web_id) for a list-member-info type call. this doesn’t change when the email address changes

Returns:

  • (Hash)

    of data and success/error counts

    • Int

      success_count the number of successful adds

    • Int

      error_count the number of unsuccessful adds

    • Array

      errors array of error structs including:

      - [Hash] email whatever was passed in the email parameter
          - [String] email the email address added
          - [String] euid the email unique id
          - [String] leid the list member's truly unique id
      - [String] code the error code
      - [String] error the error message
      
    • Array

      data array of structs for each member added

      - [Hash] email whatever was passed in the email parameter
          - [String] email the email address added
          - [String] euid the email unique id
          - [String] leid the list member's truly unique id
      


1735
1736
1737
1738
# File 'lib/mailchimp/api.rb', line 1735

def add(id, emails)
    _params = {:id => id, :emails => emails}
    return @master.call 'vip/add', _params
end

#del(id, emails) ⇒ Hash

Remove VIPs - this does not affect list membership

Parameters:

  • id (String)

    the list id to connect to. Get by calling lists/list()

  • emails (Array)

    an array of up to 50 email address structs to remove, each with with one of the following keys

    • String

      email an email address - for new subscribers obviously this should be used

    • String

      euid the unique id for an email address (not list related) - the email “id” returned from listMemberInfo, Webhooks, Campaigns, etc.

    • String

      leid the list email id (previously called web_id) for a list-member-info type call. this doesn’t change when the email address changes

Returns:

  • (Hash)

    of data and success/error counts

    • Int

      success_count the number of successful deletions

    • Int

      error_count the number of unsuccessful deletions

    • Array

      errors array of error structs including:

      - [Hash] email whatever was passed in the email parameter
          - [String] email the email address
          - [String] euid the email unique id
          - [String] leid the list member's truly unique id
      - [String] code the error code
      - [String] msg the error message
      
    • Array

      data array of structs for each member deleted

      - [Hash] email whatever was passed in the email parameter
          - [String] email the email address
          - [String] euid the email unique id
          - [String] leid the list member's truly unique id
      


1761
1762
1763
1764
# File 'lib/mailchimp/api.rb', line 1761

def del(id, emails)
    _params = {:id => id, :emails => emails}
    return @master.call 'vip/del', _params
end

#membersArray

Retrieve all Golden Monkey(s) for an account

Returns:

  • (Array)

    structs for each Golden Monkey, including:

    • String

      list_id The id of the List the Member appears on

    • String

      list_name The name of the List the Member appears on

    • String

      email The email address of the member

    • String

      fname IF a FNAME merge field exists on the list, that value for the member

    • String

      lname IF a LNAME merge field exists on the list, that value for the member

    • Int

      member_rating the rating of the subscriber. This will be 1 - 5 as described <a href=“eepurl.com/f-2P” target=“_blank”>here</a>

    • String

      member_since the datetime the member was added and/or confirmed



1775
1776
1777
1778
# File 'lib/mailchimp/api.rb', line 1775

def members()
    _params = {}
    return @master.call 'vip/members', _params
end