mailchimp-api 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mailchimp/api.rb +221 -130
- data/lib/mailchimp/errors.rb +1 -1
- metadata +4 -4
data/lib/mailchimp/api.rb
CHANGED
@@ -19,7 +19,7 @@ module Mailchimp
|
|
19
19
|
end
|
20
20
|
|
21
21
|
# Delete a campaign, autoresponder, or template folder. Note that this will simply make whatever was in the folder appear unfiled, no other data is removed
|
22
|
-
# @param [Int] fid the folder id to delete - retrieve from folders()
|
22
|
+
# @param [Int] fid the folder id to delete - retrieve from folders/list()
|
23
23
|
# @param [String] type the type of folder to delete - either "campaign", "autoresponder", or "template"
|
24
24
|
# @return [Hash] with a single entry:
|
25
25
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
@@ -31,7 +31,7 @@ module Mailchimp
|
|
31
31
|
# List all the folders of a certain type
|
32
32
|
# @param [String] type the type of folders to return "campaign", "autoresponder", or "template"
|
33
33
|
# @return [Array] structs for each folder, including:
|
34
|
-
# - [Int] folder_id Folder Id for the given folder, this can be used in the campaigns() function to filter on.
|
34
|
+
# - [Int] folder_id Folder Id for the given folder, this can be used in the campaigns/list() function to filter on.
|
35
35
|
# - [String] name Name of the given folder
|
36
36
|
# - [String] date_created The date/time the folder was created
|
37
37
|
# - [String] type The type of the folders being returned, just to make sure you know.
|
@@ -42,7 +42,7 @@ module Mailchimp
|
|
42
42
|
end
|
43
43
|
|
44
44
|
# Update the name of a folder for campaigns, autoresponders, or templates
|
45
|
-
# @param [Int] fid the folder id to update - retrieve from folders()
|
45
|
+
# @param [Int] fid the folder id to update - retrieve from folders/list()
|
46
46
|
# @param [String] name a new, unique name for the folder (max 100 bytes)
|
47
47
|
# @param [String] type the type of folder to update - one of "campaign", "autoresponder", or "template".
|
48
48
|
# @return [Hash] with a single entry:
|
@@ -81,7 +81,7 @@ module Mailchimp
|
|
81
81
|
end
|
82
82
|
|
83
83
|
# Pull details for a specific template to help support editing
|
84
|
-
# @param [Int] template_id the template id - get from templates()
|
84
|
+
# @param [Int] template_id the template id - get from templates/list()
|
85
85
|
# @param [String] type optional the template type to load - one of 'user', 'gallery', 'base', defaults to user.
|
86
86
|
# @return [Hash] info to be used when editing
|
87
87
|
# - [Hash] default_content the default content broken down into the named editable sections for the template - dependant upon template, so not documented
|
@@ -230,6 +230,19 @@ module Mailchimp
|
|
230
230
|
return @master.call 'users/logins', _params
|
231
231
|
end
|
232
232
|
|
233
|
+
# Retrieve the profile for the login owning the provided API Key
|
234
|
+
# @return [Hash] the current user's details, including:
|
235
|
+
# - [Int] id the login id for this login
|
236
|
+
# - [String] username the username used to log in
|
237
|
+
# - [String] name a display name for the account - empty first/last names will return the username
|
238
|
+
# - [String] email the email tied to the account used for passwords resets and the ilk
|
239
|
+
# - [String] role the role assigned to the account
|
240
|
+
# - [String] avatar if available, the url for the login's avatar
|
241
|
+
def profile()
|
242
|
+
_params = {}
|
243
|
+
return @master.call 'users/profile', _params
|
244
|
+
end
|
245
|
+
|
233
246
|
end
|
234
247
|
class Helper
|
235
248
|
attr_accessor :master
|
@@ -409,7 +422,7 @@ module Mailchimp
|
|
409
422
|
# - [Int] total total campaigns matching
|
410
423
|
# - [Array] results matching campaigns and snippets
|
411
424
|
# - [String] snippet the matching snippet for the campaign
|
412
|
-
# - [Hash] campaign the matching campaign's details - will return same data as single campaign from campaigns()
|
425
|
+
# - [Hash] campaign the matching campaign's details - will return same data as single campaign from campaigns/list()
|
413
426
|
# - [Hash] summary if available, the matching campaign's report/summary data, other wise empty
|
414
427
|
def search_campaigns(query, offset=0, snip_start=nil, snip_end=nil)
|
415
428
|
_params = {:query => query, :offset => offset, :snip_start => snip_start, :snip_end => snip_end}
|
@@ -418,15 +431,15 @@ module Mailchimp
|
|
418
431
|
|
419
432
|
# Search account wide or on a specific list using the specified query terms
|
420
433
|
# @param [String] query terms to search on, <a href="http://kb.mailchimp.com/article/i-cant-find-a-recipient-on-my-list" target="_blank">just like you do in the app</a>
|
421
|
-
# @param [String] id optional the list id to limit the search to. Get by calling lists()
|
434
|
+
# @param [String] id optional the list id to limit the search to. Get by calling lists/list()
|
422
435
|
# @param [Int] offset optional the paging offset to use if more than 100 records match
|
423
436
|
# @return [Hash] An array of both exact matches and partial matches over a full search
|
424
437
|
# - [Hash] exact_matches containing the total matches and current results
|
425
438
|
# - [Int] total total members matching
|
426
|
-
# - [Array] members each entry will be struct matching the data format for a single member as returned by
|
439
|
+
# - [Array] members each entry will be struct matching the data format for a single member as returned by lists/member-info()
|
427
440
|
# - [Hash] full_search containing the total matches and current results
|
428
441
|
# - [Int] total total members matching
|
429
|
-
# - [Array] members each entry will be struct matching the data format for a single member as returned by
|
442
|
+
# - [Array] members each entry will be struct matching the data format for a single member as returned by lists/member-info()
|
430
443
|
def search_members(query, id=nil, offset=0)
|
431
444
|
_params = {:query => query, :id => id, :offset => offset}
|
432
445
|
return @master.call 'helper/search-members', _params
|
@@ -543,24 +556,24 @@ module Mailchimp
|
|
543
556
|
end
|
544
557
|
|
545
558
|
# Get all email addresses that complained about a campaign sent to a list
|
546
|
-
# @param [String] id the list id to pull abuse reports for (can be gathered using lists())
|
559
|
+
# @param [String] id the list id to pull abuse reports for (can be gathered using lists/list())
|
547
560
|
# @param [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
548
561
|
# @param [Int] limit optional for large data sets, the number of results to return - defaults to 500, upper limit set at 1000
|
549
562
|
# @param [String] since optional pull only messages since this time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
|
550
563
|
# @return [Hash] the total of all reports and the specific reports reports this page
|
551
564
|
# - [Int] total the total number of matching abuse reports
|
552
565
|
# - [Array] data structs for the actual data for each reports, including:
|
553
|
-
# - [String] date date
|
566
|
+
# - [String] date date+time the abuse report was received and processed
|
554
567
|
# - [String] email the email address that reported abuse
|
555
568
|
# - [String] campaign_id the unique id for the campaign that report was made against
|
556
|
-
# - [String] type an internal type generally specifying the
|
569
|
+
# - [String] type an internal type generally specifying the originating mail provider - may not be useful outside of filling report views
|
557
570
|
def abuse_reports(id, start=0, limit=500, since=nil)
|
558
571
|
_params = {:id => id, :start => start, :limit => limit, :since => since}
|
559
572
|
return @master.call 'lists/abuse-reports', _params
|
560
573
|
end
|
561
574
|
|
562
575
|
# Access up to the previous 180 days of daily detailed aggregated activity stats for a given list. Does not include AutoResponder activity.
|
563
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
576
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
564
577
|
# @return [Array] of structs containing daily values, each containing:
|
565
578
|
def activity(id)
|
566
579
|
_params = {:id => id}
|
@@ -568,7 +581,7 @@ module Mailchimp
|
|
568
581
|
end
|
569
582
|
|
570
583
|
# Subscribe a batch of email addresses to a list at once. If you are using a serialized version of the API, we strongly suggest that you only run this method as a POST request, and <em>not</em> a GET request. Maximum batch sizes vary based on the amount of data in each record, though you should cap them at 5k - 10k records, depending on your experience. These calls are also long, so be sure you increase your timeout values.
|
571
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
584
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
572
585
|
# @param [Array] batch an array of structs for each address using the following keys:
|
573
586
|
# - [Hash] email a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Provide multiples and we'll use the first we see in this same order.
|
574
587
|
# - [String] email an email address
|
@@ -605,7 +618,7 @@ module Mailchimp
|
|
605
618
|
end
|
606
619
|
|
607
620
|
# Unsubscribe a batch of email addresses from a list
|
608
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
621
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
609
622
|
# @param [Array] batch array of structs to unsubscribe, each with one of the following keys - failing to provide anything will produce an error relating to the email address. Provide multiples and we'll use the first we see in this same order.
|
610
623
|
# - [String] email an email address
|
611
624
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
@@ -630,7 +643,7 @@ module Mailchimp
|
|
630
643
|
end
|
631
644
|
|
632
645
|
# Retrieve the clients that the list's subscribers have been tagged as being used based on user agents seen. Made possible by <a href="http://user-agent-string.info" target="_blank">user-agent-string.info</a>
|
633
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
646
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
634
647
|
# @return [Hash] the desktop and mobile user agents in use on the list
|
635
648
|
# - [Hash] desktop desktop user agents and percentages
|
636
649
|
# - [Double] penetration the percent of desktop clients in use
|
@@ -652,7 +665,7 @@ module Mailchimp
|
|
652
665
|
end
|
653
666
|
|
654
667
|
# Access the Growth History by Month in aggregate or for a given list.
|
655
|
-
# @param [String] id optional - if provided, the list id to connect to. Get by calling lists/list. Otherwise the aggregate for the account.
|
668
|
+
# @param [String] id optional - if provided, the list id to connect to. Get by calling lists/list(). Otherwise the aggregate for the account.
|
656
669
|
# @return [Array] array of structs containing months and growth data
|
657
670
|
# - [String] month The Year and Month in question using YYYY-MM format
|
658
671
|
# - [Int] existing number of existing subscribers to start the month
|
@@ -664,7 +677,7 @@ module Mailchimp
|
|
664
677
|
end
|
665
678
|
|
666
679
|
# Get the list of interest groupings for a given list, including the label, form information, and included groups for each
|
667
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
680
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
668
681
|
# @param [Bool] counts optional whether or not to return subscriber counts for each group. defaults to false since that slows this call down a ton for large lists.
|
669
682
|
# @return [Array] array of structs of the interest groupings for the list
|
670
683
|
# - [Int] id The id for the Grouping
|
@@ -681,9 +694,9 @@ module Mailchimp
|
|
681
694
|
end
|
682
695
|
|
683
696
|
# Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first group will automatically turn them on.
|
684
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
697
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
685
698
|
# @param [String] group_name the interest group to add - group names must be unique within a grouping
|
686
|
-
# @param [Int] grouping_id optional The grouping to add the new group to - get using
|
699
|
+
# @param [Int] grouping_id optional The grouping to add the new group to - get using lists/interest-groupings() . If not supplied, the first grouping on the list is used.
|
687
700
|
# @return [Hash] with a single entry:
|
688
701
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
689
702
|
def interest_group_add(id, group_name, grouping_id=nil)
|
@@ -692,9 +705,9 @@ module Mailchimp
|
|
692
705
|
end
|
693
706
|
|
694
707
|
# Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.
|
695
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
708
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
696
709
|
# @param [String] group_name the interest group to delete
|
697
|
-
# @param [Int] grouping_id The grouping to delete the group from - get using
|
710
|
+
# @param [Int] grouping_id The grouping to delete the group from - get using lists/interest-groupings() . If not supplied, the first grouping on the list is used.
|
698
711
|
# @return [Hash] with a single entry:
|
699
712
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
700
713
|
def interest_group_del(id, group_name, grouping_id=nil)
|
@@ -703,10 +716,10 @@ module Mailchimp
|
|
703
716
|
end
|
704
717
|
|
705
718
|
# Change the name of an Interest Group
|
706
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
719
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
707
720
|
# @param [String] old_name the interest group name to be changed
|
708
721
|
# @param [String] new_name the new interest group name to be set
|
709
|
-
# @param [Int] grouping_id optional The grouping to delete the group from - get using
|
722
|
+
# @param [Int] grouping_id optional The grouping to delete the group from - get using lists/interest-groupings() . If not supplied, the first grouping on the list is used.
|
710
723
|
# @return [Hash] with a single entry:
|
711
724
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
712
725
|
def interest_group_update(id, old_name, new_name, grouping_id=nil)
|
@@ -715,7 +728,7 @@ module Mailchimp
|
|
715
728
|
end
|
716
729
|
|
717
730
|
# Add a new Interest Grouping - if interest groups for the List are not yet enabled, adding the first grouping will automatically turn them on.
|
718
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
731
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
719
732
|
# @param [String] name the interest grouping to add - grouping names must be unique
|
720
733
|
# @param [String] type The type of the grouping to add - one of "checkboxes", "hidden", "dropdown", "radio"
|
721
734
|
# @param [Array] groups The lists of initial group names to be added - at least 1 is required and the names must be unique within a grouping. If the number takes you over the 60 group limit, an error will be thrown.
|
@@ -727,7 +740,7 @@ module Mailchimp
|
|
727
740
|
end
|
728
741
|
|
729
742
|
# Delete an existing Interest Grouping - this will permanently delete all contained interest groups and will remove those selections from all list members
|
730
|
-
# @param [Int] grouping_id the interest grouping id - get from
|
743
|
+
# @param [Int] grouping_id the interest grouping id - get from lists/interest-groupings()
|
731
744
|
# @return [Hash] with a single entry:
|
732
745
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
733
746
|
def interest_grouping_del(grouping_id)
|
@@ -736,7 +749,7 @@ module Mailchimp
|
|
736
749
|
end
|
737
750
|
|
738
751
|
# Update an existing Interest Grouping
|
739
|
-
# @param [Int] grouping_id the interest grouping id - get from
|
752
|
+
# @param [Int] grouping_id the interest grouping id - get from lists/interest-groupings()
|
740
753
|
# @param [String] name The name of the field to update - either "name" or "type". Groups within the grouping should be manipulated using the standard listInterestGroup* methods
|
741
754
|
# @param [String] value The new value of the field. Grouping names must be unique - only "hidden" and "checkboxes" grouping types can be converted between each other.
|
742
755
|
# @return [Hash] with a single entry:
|
@@ -747,7 +760,7 @@ module Mailchimp
|
|
747
760
|
end
|
748
761
|
|
749
762
|
# Retrieve the locations (countries) that the list's subscribers have been tagged to based on geocoding their IP address
|
750
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
763
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
751
764
|
# @return [Array] array of locations
|
752
765
|
# - [String] country the country name
|
753
766
|
# - [String] cc the ISO 3166 2 digit country code
|
@@ -759,7 +772,7 @@ module Mailchimp
|
|
759
772
|
end
|
760
773
|
|
761
774
|
# Get the most recent 100 activities for particular list members (open, click, bounce, unsub, abuse, sent to, etc.)
|
762
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
775
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
763
776
|
# @param [Array] emails an array of up to 50 email structs, each with with one of the following keys
|
764
777
|
# - [String] email an email address - for new subscribers obviously this should be used
|
765
778
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
@@ -781,7 +794,7 @@ module Mailchimp
|
|
781
794
|
# - [String] leid the list member's truly unique id
|
782
795
|
# - [Array] activity an array of structs containing the activity, including:
|
783
796
|
# - [String] action The action name, one of: open, click, bounce, unsub, abuse, sent, queued, ecomm, mandrill_send, mandrill_hard_bounce, mandrill_soft_bounce, mandrill_open, mandrill_click, mandrill_spam, mandrill_unsub, mandrill_reject
|
784
|
-
# - [String] timestamp The date
|
797
|
+
# - [String] timestamp The date+time of the action (GMT)
|
785
798
|
# - [String] url For click actions, the url clicked, otherwise this is empty
|
786
799
|
# - [String] type If there's extra bounce, unsub, etc data it will show up here.
|
787
800
|
# - [String] campaign_id The campaign id the action was related to, if it exists - otherwise empty (ie, direct unsub from list)
|
@@ -792,7 +805,7 @@ module Mailchimp
|
|
792
805
|
end
|
793
806
|
|
794
807
|
# Get all the information for particular members of a list
|
795
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
808
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
796
809
|
# @param [Array] emails an array of up to 50 email structs, each with with one of the following keys
|
797
810
|
# - [String] email an email address - for new subscribers obviously this should be used
|
798
811
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
@@ -819,15 +832,15 @@ module Mailchimp
|
|
819
832
|
# - [Bool] interested whether the member has this group selected
|
820
833
|
# - [String] status The subscription status for this email address, either pending, subscribed, unsubscribed, or cleaned
|
821
834
|
# - [String] ip_signup IP Address this address signed up from. This may be blank if single optin is used.
|
822
|
-
# - [String] timestamp_signup The date
|
835
|
+
# - [String] timestamp_signup The date+time the double optin was initiated. This may be blank if single optin is used.
|
823
836
|
# - [String] ip_opt IP Address this address opted in from.
|
824
|
-
# - [String] timestamp_opt The date
|
837
|
+
# - [String] timestamp_opt The date+time the optin completed
|
825
838
|
# - [Int] member_rating the rating of the subscriber. This will be 1 - 5 as described <a href="http://eepurl.com/f-2P" target="_blank">here</a>
|
826
839
|
# - [String] campaign_id If the user is unsubscribed and they unsubscribed from a specific campaign, that campaign_id will be listed, otherwise this is not returned.
|
827
840
|
# - [Array] lists An array of structs for the other lists this member belongs to
|
828
841
|
# - [String] id the list id
|
829
842
|
# - [String] status the members status on that list
|
830
|
-
# - [String] timestamp The date
|
843
|
+
# - [String] timestamp The date+time this email address entered it's current status
|
831
844
|
# - [String] info_changed The last time this record was changed. If the record is old enough, this may be blank.
|
832
845
|
# - [Int] web_id The Member id used in our web app, allows you to create a link directly to it
|
833
846
|
# - [Int] leid The Member id used in our web app, allows you to create a link directly to it
|
@@ -861,8 +874,8 @@ module Mailchimp
|
|
861
874
|
return @master.call 'lists/member-info', _params
|
862
875
|
end
|
863
876
|
|
864
|
-
# Get all of the list members for a list that are of a particular status and potentially matching a segment. This will cause locking, so don't run multiples at once. Are you trying to get a dump including lots of merge data or specific members of a list? If so, checkout the <a href="export/1.0/list.func.php">List Export API</a>
|
865
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
877
|
+
# Get all of the list members for a list that are of a particular status and potentially matching a segment. This will cause locking, so don't run multiples at once. Are you trying to get a dump including lots of merge data or specific members of a list? If so, checkout the <a href="/export/1.0/list.func.php">List Export API</a>
|
878
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
866
879
|
# @param [String] status the status to get members for - one of(subscribed, unsubscribed, <a target="_blank" href="http://eepurl.com/gWOO">cleaned</a>), defaults to subscribed
|
867
880
|
# @param [Hash] opts various options for controlling returned data
|
868
881
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
@@ -879,16 +892,16 @@ module Mailchimp
|
|
879
892
|
end
|
880
893
|
|
881
894
|
# Add a new merge tag to a given list
|
882
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
895
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
883
896
|
# @param [String] tag The merge tag to add, e.g. FNAME. 10 bytes max, valid characters: "A-Z 0-9 _" no spaces, dashes, etc. Some tags and prefixes are <a href="http://kb.mailchimp.com/article/i-got-a-message-saying-that-my-list-field-name-is-reserved-and-cant-be-used" target="_blank">reserved</a>
|
884
897
|
# @param [String] name The long description of the tag being added, used for user displays - max 50 bytes
|
885
|
-
# @param [
|
898
|
+
# @param [Hash] options optional Various options for this merge var
|
886
899
|
# - [String] field_type optional one of: text, number, radio, dropdown, date, address, phone, url, imageurl, zip, birthday - defaults to text
|
887
900
|
# - [Boolean] req optional indicates whether the field is required - defaults to false
|
888
901
|
# - [Boolean] public optional indicates whether the field is displayed in public - defaults to true
|
889
902
|
# - [Boolean] show optional indicates whether the field is displayed in the app's list member view - defaults to true
|
890
903
|
# - [Int] order The order this merge tag should be displayed in - this will cause existing values to be reset so this fits
|
891
|
-
# - [String] default_value optional the default value for the field. See subscribe() for formatting info. Defaults to blank - max 255 bytes
|
904
|
+
# - [String] default_value optional the default value for the field. See lists/subscribe() for formatting info. Defaults to blank - max 255 bytes
|
892
905
|
# - [String] helptext optional the help text to be used with some newer forms. Defaults to blank - max 255 bytes
|
893
906
|
# - [Array] choices optional kind of - an array of strings to use as the choices for radio and dropdown type fields
|
894
907
|
# - [String] dateformat optional only valid for birthday and date fields. For birthday type, must be "MM/DD" (default) or "DD/MM". For date type, must be "MM/DD/YYYY" (default) or "DD/MM/YYYY". Any other values will be converted to the default.
|
@@ -904,7 +917,7 @@ module Mailchimp
|
|
904
917
|
# - [String] default The default value for this field
|
905
918
|
# - [String] helptext The helptext for this field
|
906
919
|
# - [String] size The width of the field to be used
|
907
|
-
# - [String] tag The merge tag that's used for forms and subscribe() and
|
920
|
+
# - [String] tag The merge tag that's used for forms and lists/subscribe() and lists/update-member()
|
908
921
|
# - [Array] choices the options available for radio and dropdown field types
|
909
922
|
# - [Int] id an unchanging id for the merge var
|
910
923
|
def merge_var_add(id, tag, name, options=[])
|
@@ -913,7 +926,7 @@ module Mailchimp
|
|
913
926
|
end
|
914
927
|
|
915
928
|
# Delete a merge tag from a given list and all its members. Seriously - the data is removed from all members as well! Note that on large lists this method may seem a bit slower than calls you typically make.
|
916
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
929
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
917
930
|
# @param [String] tag The merge tag to delete
|
918
931
|
# @return [Hash] with a single entry:
|
919
932
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
@@ -923,7 +936,7 @@ module Mailchimp
|
|
923
936
|
end
|
924
937
|
|
925
938
|
# Completely resets all data stored in a merge var on a list. All data is removed and this action can not be undone.
|
926
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
939
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
927
940
|
# @param [String] tag The merge tag to reset
|
928
941
|
# @return [Hash] with a single entry:
|
929
942
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
@@ -933,9 +946,9 @@ module Mailchimp
|
|
933
946
|
end
|
934
947
|
|
935
948
|
# Sets a particular merge var to the specified value for every list member. Only merge var ids 1 - 30 may be modified this way. This is generally a dirty method unless you're fixing data since you should probably be using default_values and/or conditional content. as with lists/merge-var-reset(), this can not be undone.
|
936
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
949
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
937
950
|
# @param [String] tag The merge tag to reset
|
938
|
-
# @param [String] value The value to set - see subscribe() for formatting. Must validate to something non-empty.
|
951
|
+
# @param [String] value The value to set - see lists/subscribe() for formatting. Must validate to something non-empty.
|
939
952
|
# @return [Hash] with a single entry:
|
940
953
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
941
954
|
def merge_var_set(id, tag, value)
|
@@ -944,9 +957,9 @@ module Mailchimp
|
|
944
957
|
end
|
945
958
|
|
946
959
|
# Update most parameters for a merge tag on a given list. You cannot currently change the merge type
|
947
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
960
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
948
961
|
# @param [String] tag The merge tag to update
|
949
|
-
# @param [Hash] options The options to change for a merge var. See
|
962
|
+
# @param [Hash] options The options to change for a merge var. See lists/merge-var-add() for valid options. "tag" and "name" may also be used here.
|
950
963
|
# @return [Hash] the full data for the new merge var, just like merge-vars returns
|
951
964
|
# - [String] name Name/description of the merge field
|
952
965
|
# - [Bool] req Denotes whether the field is required (true) or not (false)
|
@@ -957,7 +970,7 @@ module Mailchimp
|
|
957
970
|
# - [String] default The default value for this field
|
958
971
|
# - [String] helptext The helptext for this field
|
959
972
|
# - [String] size The width of the field to be used
|
960
|
-
# - [String] tag The merge tag that's used for forms and subscribe() and
|
973
|
+
# - [String] tag The merge tag that's used for forms and lists/subscribe() and lists/update-member()
|
961
974
|
# - [Array] choices the options available for radio and dropdown field types
|
962
975
|
# - [Int] id an unchanging id for the merge var
|
963
976
|
def merge_var_update(id, tag, options)
|
@@ -966,7 +979,7 @@ module Mailchimp
|
|
966
979
|
end
|
967
980
|
|
968
981
|
# Get the list of merge tags for a given list, including their name, tag, and required setting
|
969
|
-
# @param [Array] id the list ids to retrieve merge vars for. Get by calling lists() - max of 100
|
982
|
+
# @param [Array] id the list ids to retrieve merge vars for. Get by calling lists/list() - max of 100
|
970
983
|
# @return [Hash] of data and success/error counts
|
971
984
|
# - [Int] success_count the number of subscribers successfully found on the list
|
972
985
|
# - [Int] error_count the number of subscribers who were not found on the list
|
@@ -983,7 +996,7 @@ module Mailchimp
|
|
983
996
|
# - [String] default The default value the list owner has set for this field
|
984
997
|
# - [String] helptext The helptext for this field
|
985
998
|
# - [String] size The width of the field to be used
|
986
|
-
# - [String] tag The merge tag that's used for forms and
|
999
|
+
# - [String] tag The merge tag that's used for forms and lists/subscribe() and listUpdateMember()
|
987
1000
|
# - [Array] choices For radio and dropdown field types, an array of the options available
|
988
1001
|
# - [Int] id an unchanging id for the merge var
|
989
1002
|
# - [Array] errors of error structs
|
@@ -995,8 +1008,73 @@ module Mailchimp
|
|
995
1008
|
return @master.call 'lists/merge-vars', _params
|
996
1009
|
end
|
997
1010
|
|
1011
|
+
# Retrieve all of Segments for a list.
|
1012
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1013
|
+
# @param [String] type optional, if specified should be "static" or "saved" and will limit the returned entries to that type
|
1014
|
+
# @return [Hash] with 2 keys:
|
1015
|
+
# - [Int] static.id the id of the segment
|
1016
|
+
# - [String] created_date the date+time the segment was created
|
1017
|
+
# - [String] last_update the date+time the segment was last updated (add or del)
|
1018
|
+
def segments(id, type=nil)
|
1019
|
+
_params = {:id => id, :type => type}
|
1020
|
+
return @master.call 'lists/segments', _params
|
1021
|
+
end
|
1022
|
+
|
1023
|
+
# Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance. When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation options), though performance may degrade at that point. Saved Segments (called "auto-updating" in the app) are essentially just the match+conditions typically used.
|
1024
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1025
|
+
# @param [Hash] opts various options for the new segment
|
1026
|
+
# - [String] type either "static" or "saved"
|
1027
|
+
# - [String] name a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
|
1028
|
+
# - [Hash] segment_opts for "saved" only, the standard segment match+conditions, just like campaigns/segment-test
|
1029
|
+
# - [String] match "any" or "all"
|
1030
|
+
# - [Array] conditions structs for each condition, just like campaigns/segment-test
|
1031
|
+
# @return [Hash] with a single entry:
|
1032
|
+
# - [Int] id the id of the new segment, otherwise an error will be thrown.
|
1033
|
+
def segment_add(id, opts)
|
1034
|
+
_params = {:id => id, :opts => opts}
|
1035
|
+
return @master.call 'lists/segment-add', _params
|
1036
|
+
end
|
1037
|
+
|
1038
|
+
# Delete a segment. Note that this will, of course, remove any member affiliations with any static segments deleted
|
1039
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1040
|
+
# @param [Int] seg_id the id of the static segment to delete - get from lists/static-segments()
|
1041
|
+
# @return [Hash] with a single entry:
|
1042
|
+
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
1043
|
+
def segment_del(id, seg_id)
|
1044
|
+
_params = {:id => id, :seg_id => seg_id}
|
1045
|
+
return @master.call 'lists/segment-del', _params
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
# Allows one to test their segmentation rules before creating a campaign using them - this is no different from campaigns/segment-test() and will eventually replace it. For the time being, the crazy segmenting condition documentation will continue to live over there.
|
1049
|
+
# @param [String] list_id the list to test segmentation on - get lists using lists/list()
|
1050
|
+
# @param [Hash] options with 1 or 2 keys:
|
1051
|
+
# - [String] saved_segment_id a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required.
|
1052
|
+
# - [String] match controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
|
1053
|
+
# - [Array] conditions of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
|
1054
|
+
# @return [Hash] with a single entry:
|
1055
|
+
# - [Int] total The total number of subscribers matching your segmentation options
|
1056
|
+
def segment_test(list_id, options)
|
1057
|
+
_params = {:list_id => list_id, :options => options}
|
1058
|
+
return @master.call 'lists/segment-test', _params
|
1059
|
+
end
|
1060
|
+
|
1061
|
+
# Update an existing segment. The list and type can not be changed.
|
1062
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1063
|
+
# @param [Int] seg_id the segment to updated. Get by calling lists/segments()
|
1064
|
+
# @param [Hash] opts various options to update
|
1065
|
+
# - [String] name a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
|
1066
|
+
# - [Hash] segment_opts for "saved" only, the standard segment match+conditions, just like campaigns/segment-test
|
1067
|
+
# - [Hash] match "any" or "all"
|
1068
|
+
# - [Array] conditions structs for each condition, just like campaigns/segment-test
|
1069
|
+
# @return [Hash] with a single entry:
|
1070
|
+
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
1071
|
+
def segment_update(id, seg_id, opts)
|
1072
|
+
_params = {:id => id, :seg_id => seg_id, :opts => opts}
|
1073
|
+
return @master.call 'lists/segment-update', _params
|
1074
|
+
end
|
1075
|
+
|
998
1076
|
# Save a segment against a list for later use. There is no limit to the number of segments which can be saved. Static Segments <strong>are not</strong> tied to any merge data, interest groups, etc. They essentially allow you to configure an unlimited number of custom segments which will have standard performance. When using proper segments, Static Segments are one of the available options for segmentation just as if you used a merge var (and they can be used with other segmentation options), though performance may degrade at that point.
|
999
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1077
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1000
1078
|
# @param [String] name a unique name per list for the segment - 100 byte maximum length, anything longer will throw an error
|
1001
1079
|
# @return [Hash] with a single entry:
|
1002
1080
|
# - [Int] id the id of the new segment, otherwise an error will be thrown.
|
@@ -1006,8 +1084,8 @@ module Mailchimp
|
|
1006
1084
|
end
|
1007
1085
|
|
1008
1086
|
# Delete a static segment. Note that this will, of course, remove any member affiliations with the segment
|
1009
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1010
|
-
# @param [Int] seg_id the id of the static segment to delete - get from
|
1087
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1088
|
+
# @param [Int] seg_id the id of the static segment to delete - get from lists/static-segments()
|
1011
1089
|
# @return [Hash] with a single entry:
|
1012
1090
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
1013
1091
|
def static_segment_del(id, seg_id)
|
@@ -1016,13 +1094,12 @@ module Mailchimp
|
|
1016
1094
|
end
|
1017
1095
|
|
1018
1096
|
# Add list members to a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list in order to be included - this <strong>will not</strong> subscribe them to the list!
|
1019
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1020
|
-
# @param [Int] seg_id the id of the static segment to modify - get from
|
1021
|
-
# @param [Array] batch an array of structs for
|
1022
|
-
# - [
|
1023
|
-
#
|
1024
|
-
#
|
1025
|
-
# - [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
|
1097
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1098
|
+
# @param [Int] seg_id the id of the static segment to modify - get from lists/static-segments()
|
1099
|
+
# @param [Array] batch an array of structs for each address using the following keys:
|
1100
|
+
# - [String] email an email address
|
1101
|
+
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
1102
|
+
# - [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
|
1026
1103
|
# @return [Hash] an array with the results of the operation
|
1027
1104
|
# - [Int] success_count the total number of successful updates (will include members already in the segment)
|
1028
1105
|
# - [Array] errors structs for each error including:
|
@@ -1038,13 +1115,12 @@ module Mailchimp
|
|
1038
1115
|
end
|
1039
1116
|
|
1040
1117
|
# Remove list members from a static segment. It is suggested that you limit batch size to no more than 10,000 addresses per call. Email addresses must exist on the list in order to be removed - this <strong>will not</strong> unsubscribe them from the list!
|
1041
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1042
|
-
# @param [Int] seg_id the id of the static segment to delete - get from
|
1043
|
-
# @param [Array] batch an array of structs for each address using the following keys:
|
1044
|
-
# - [
|
1045
|
-
#
|
1046
|
-
#
|
1047
|
-
# - [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
|
1118
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1119
|
+
# @param [Int] seg_id the id of the static segment to delete - get from lists/static-segments()
|
1120
|
+
# @param [Array] batch an array of structs for each address using one of the following keys:
|
1121
|
+
# - [String] email an email address
|
1122
|
+
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
1123
|
+
# - [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
|
1048
1124
|
# @return [Hash] an array with the results of the operation
|
1049
1125
|
# - [Int] success_count the total number of successful removals
|
1050
1126
|
# - [Int] error_count the total number of unsuccessful removals
|
@@ -1061,8 +1137,8 @@ module Mailchimp
|
|
1061
1137
|
end
|
1062
1138
|
|
1063
1139
|
# Resets a static segment - removes <strong>all</strong> members from the static segment. Note: does not actually affect list member data
|
1064
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1065
|
-
# @param [Int] seg_id the id of the static segment to reset - get from
|
1140
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1141
|
+
# @param [Int] seg_id the id of the static segment to reset - get from lists/static-segments()
|
1066
1142
|
# @return [Hash] with a single entry:
|
1067
1143
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
1068
1144
|
def static_segment_reset(id, seg_id)
|
@@ -1071,14 +1147,14 @@ module Mailchimp
|
|
1071
1147
|
end
|
1072
1148
|
|
1073
1149
|
# Retrieve all of the Static Segments for a list.
|
1074
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1150
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1075
1151
|
# @return [Array] an of structs with data for each static segment
|
1076
1152
|
# - [Int] id the id of the segment
|
1077
1153
|
# - [String] name the name for the segment
|
1078
1154
|
# - [Int] member_count the total number of subscribed members currently in a segment
|
1079
|
-
# - [String] created_date the date
|
1080
|
-
# - [String] last_update the date
|
1081
|
-
# - [String] last_reset the date
|
1155
|
+
# - [String] created_date the date+time the segment was created
|
1156
|
+
# - [String] last_update the date+time the segment was last updated (add or del)
|
1157
|
+
# - [String] last_reset the date+time the segment was last reset (ie had all members cleared from it)
|
1082
1158
|
def static_segments(id)
|
1083
1159
|
_params = {:id => id}
|
1084
1160
|
return @master.call 'lists/static-segments', _params
|
@@ -1122,7 +1198,7 @@ module Mailchimp
|
|
1122
1198
|
end
|
1123
1199
|
|
1124
1200
|
# Unsubscribe the given email address from the list
|
1125
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1201
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1126
1202
|
# @param [Hash] email a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Providing multiples and will use the first we see in this same order.
|
1127
1203
|
# - [String] email an email address
|
1128
1204
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
@@ -1137,13 +1213,13 @@ module Mailchimp
|
|
1137
1213
|
return @master.call 'lists/unsubscribe', _params
|
1138
1214
|
end
|
1139
1215
|
|
1140
|
-
# Edit the email address, merge fields, and interest groups for a list member. If you are doing a batch update on lots of users, consider using
|
1141
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1216
|
+
# Edit the email address, merge fields, and interest groups for a list member. If you are doing a batch update on lots of users, consider using lists/batch-subscribe() with the update_existing and possible replace_interests parameter.
|
1217
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1142
1218
|
# @param [Hash] email a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Providing multiples and will use the first we see in this same order.
|
1143
1219
|
# - [String] email an email address
|
1144
1220
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
1145
1221
|
# - [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
|
1146
|
-
# @param [Array] merge_vars array of new field values to update the member with. See merge_vars in
|
1222
|
+
# @param [Array] merge_vars array of new field values to update the member with. See merge_vars in lists/subscribe() for details.
|
1147
1223
|
# @param [String] email_type change the email type preference for the member ("html" or "text"). Leave blank to keep the existing preference (optional)
|
1148
1224
|
# @param [Boolean] replace_interests flag to determine whether we replace the interest groups with the updated groups provided, or we add the provided groups to the member's interest groups (optional, defaults to true)
|
1149
1225
|
# @return [Hash] the ids for this subscriber
|
@@ -1156,7 +1232,7 @@ module Mailchimp
|
|
1156
1232
|
end
|
1157
1233
|
|
1158
1234
|
# Add a new Webhook URL for the given list
|
1159
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1235
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1160
1236
|
# @param [String] url a valid URL for the Webhook - it will be validated. note that a url may only exist on a list once.
|
1161
1237
|
# @param [Hash] actions optional a hash of actions to fire this Webhook for
|
1162
1238
|
# - [Bool] subscribe optional as subscribes occur, defaults to true
|
@@ -1177,7 +1253,7 @@ module Mailchimp
|
|
1177
1253
|
end
|
1178
1254
|
|
1179
1255
|
# Delete an existing Webhook URL from a given list
|
1180
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1256
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1181
1257
|
# @param [String] url the URL of a Webhook on this list
|
1182
1258
|
# @return [Hash] with a single entry:
|
1183
1259
|
# - [Bool] complete whether the call worked. reallistically this will always be true as errors will be thrown otherwise.
|
@@ -1187,7 +1263,7 @@ module Mailchimp
|
|
1187
1263
|
end
|
1188
1264
|
|
1189
1265
|
# Return the Webhooks configured for the given list
|
1190
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1266
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1191
1267
|
# @return [Array] of structs for each webhook
|
1192
1268
|
# - [String] url the URL for this Webhook
|
1193
1269
|
# - [Hash] actions the possible actions and whether they are enabled
|
@@ -1213,8 +1289,8 @@ module Mailchimp
|
|
1213
1289
|
# - [String] from_name optional - only lists that have a default from name matching this
|
1214
1290
|
# - [String] from_email optional - only lists that have a default from email matching this
|
1215
1291
|
# - [String] from_subject optional - only lists that have a default from email matching this
|
1216
|
-
# - [String] created_before optional - only show lists that were created before this date
|
1217
|
-
# - [String] created_after optional - only show lists that were created since this date
|
1292
|
+
# - [String] created_before optional - only show lists that were created before this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
|
1293
|
+
# - [String] created_after optional - only show lists that were created since this date+time - 24 hour format in <strong>GMT</strong>, eg "2013-12-30 20:30:00"
|
1218
1294
|
# - [Boolean] exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true
|
1219
1295
|
# @param [Int] start optional - control paging of lists, start results at this list #, defaults to 1st page of data (page 0)
|
1220
1296
|
# @param [Int] limit optional - control paging of lists, number of lists to return with each call, defaults to 25 (max=100)
|
@@ -1273,7 +1349,7 @@ module Mailchimp
|
|
1273
1349
|
end
|
1274
1350
|
|
1275
1351
|
# Get the content (both html and text) for a campaign either as it would appear in the campaign archive or as the raw, original content
|
1276
|
-
# @param [String] cid the campaign id to get content for (can be gathered using
|
1352
|
+
# @param [String] cid the campaign id to get content for (can be gathered using campaigns/list())
|
1277
1353
|
# @param [Hash] options various options to control this call
|
1278
1354
|
# - [String] view optional one of "archive" (default), "preview" (like our popup-preview) or "raw"
|
1279
1355
|
# - [Hash] email optional if provided, view is "archive" or "preview", the campaign's list still exists, and the requested record is subscribed to the list. the returned content will be populated with member data populated. a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Providing multiples and will use the first we see in this same order.
|
@@ -1291,7 +1367,7 @@ module Mailchimp
|
|
1291
1367
|
# Create a new draft campaign to send. You <strong>can not</strong> have more than 32,000 campaigns in your account.
|
1292
1368
|
# @param [String] type the Campaign Type to create - one of "regular", "plaintext", "absplit", "rss", "auto"
|
1293
1369
|
# @param [Hash] options a struct of the standard options for this campaign :
|
1294
|
-
# - [String] list_id the list to send this campaign to- get lists using lists()
|
1370
|
+
# - [String] list_id the list to send this campaign to- get lists using lists/list()
|
1295
1371
|
# - [String] subject the subject line for your campaign message
|
1296
1372
|
# - [String] from_email the From: email address for your campaign message
|
1297
1373
|
# - [String] from_name the From: name for your campaign message (not an email address)
|
@@ -1299,7 +1375,7 @@ module Mailchimp
|
|
1299
1375
|
# - [Int] template_id optional - use this user-created template to generate the HTML content of the campaign (takes precendence over other template options)
|
1300
1376
|
# - [Int] gallery_template_id optional - use a template from the public gallery to generate the HTML content of the campaign (takes precendence over base template options)
|
1301
1377
|
# - [Int] base_template_id optional - use this a base/start-from-scratch template to generate the HTML content of the campaign
|
1302
|
-
# - [Int] folder_id optional - automatically file the new campaign in the folder_id passed. Get using folders() - note that Campaigns and Autoresponders have separate folder
|
1378
|
+
# - [Int] folder_id optional - automatically file the new campaign in the folder_id passed. Get using folders/list() - note that Campaigns and Autoresponders have separate folder setups
|
1303
1379
|
# - [Hash] tracking optional - set which recipient actions will be tracked. Click tracking can not be disabled for Free accounts.
|
1304
1380
|
# - [Bool] opens whether to track opens, defaults to true
|
1305
1381
|
# - [Bool] html_clicks whether to track clicks in HTML content, defaults to true
|
@@ -1334,7 +1410,7 @@ module Mailchimp
|
|
1334
1410
|
# - [String] url to have us pull in content from a URL. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
|
1335
1411
|
# - [String] archive to send a Base64 encoded archive file for us to import all media from. Note, this will override any other content options - for lists with Email Format options, you'll need to turn on generate_text as well
|
1336
1412
|
# - [String] archive_type optional - only necessary for the "archive" option. Supported formats are: zip, tar.gz, tar.bz2, tar, tgz, tbz . If not included, we will default to zip
|
1337
|
-
# @param [Hash] segment_opts if you wish to do Segmentation with this campaign this array should contain: see
|
1413
|
+
# @param [Hash] segment_opts if you wish to do Segmentation with this campaign this array should contain: see campaigns/segment-test(). It's suggested that you test your options against campaigns/segment-test().
|
1338
1414
|
# @param [Hash] type_opts various extra options based on the campaign type
|
1339
1415
|
# - [Hash] rss For RSS Campaigns this, struct should contain:
|
1340
1416
|
# - [String] url the URL to pull RSS content from - it will be verified and must exist
|
@@ -1351,7 +1427,7 @@ module Mailchimp
|
|
1351
1427
|
# - [Bool] 6 optional Saturday, defaults to true
|
1352
1428
|
# - [Bool] 7 optional Sunday, defaults to true
|
1353
1429
|
# - [Hash] absplit For A/B Split campaigns, this struct should contain:
|
1354
|
-
# - [String] split_test The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call
|
1430
|
+
# - [String] split_test The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call campaigns/schedule() separately!
|
1355
1431
|
# - [String] pick_winner How the winner will be picked, one of: "opens" (by the open_rate), "clicks" (by the click rate), "manual" (you pick manually)
|
1356
1432
|
# - [Int] wait_units optional the default time unit to wait before auto-selecting a winner - use "3600" for hours, "86400" for days. Defaults to 86400.
|
1357
1433
|
# - [Int] wait_time optional the number of units to wait before auto-selecting a winner - defaults to 1, so if not set, a winner will be selected after 1 Day.
|
@@ -1399,9 +1475,9 @@ module Mailchimp
|
|
1399
1475
|
# @param [Hash] filters a struct of filters to apply to this query - all are optional:
|
1400
1476
|
# - [String] campaign_id optional - return the campaign using a know campaign_id. Accepts multiples separated by commas when not using exact matching.
|
1401
1477
|
# - [String] parent_id optional - return the child campaigns using a known parent campaign_id. Accepts multiples separated by commas when not using exact matching.
|
1402
|
-
# - [String] list_id optional - the list to send this campaign to - get lists using lists(). Accepts multiples separated by commas when not using exact matching.
|
1403
|
-
# - [Int] folder_id optional - only show campaigns from this folder id - get folders using
|
1404
|
-
# - [Int] template_id optional - only show campaigns using this template id - get templates using templates(). Accepts multiples separated by commas when not using exact matching.
|
1478
|
+
# - [String] list_id optional - the list to send this campaign to - get lists using lists/list(). Accepts multiples separated by commas when not using exact matching.
|
1479
|
+
# - [Int] folder_id optional - only show campaigns from this folder id - get folders using folders/list(). Accepts multiples separated by commas when not using exact matching.
|
1480
|
+
# - [Int] template_id optional - only show campaigns using this template id - get templates using templates/list(). Accepts multiples separated by commas when not using exact matching.
|
1405
1481
|
# - [String] status optional - return campaigns of a specific status - one of "sent", "save", "paused", "schedule", "sending". Accepts multiples separated by commas when not using exact matching.
|
1406
1482
|
# - [String] type optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "auto". Accepts multiples separated by commas when not using exact matching.
|
1407
1483
|
# - [String] from_name optional - only show campaigns that have this "From Name"
|
@@ -1447,13 +1523,19 @@ module Mailchimp
|
|
1447
1523
|
# - [Boolean] timewarp Whether or not the campaign used Timewarp
|
1448
1524
|
# - [String] timewarp_schedule The time, in GMT, that the Timewarp campaign is being sent. For A/B Split campaigns, this is blank and is instead in their schedule_a and schedule_b in the type_opts array
|
1449
1525
|
# - [String] parent_id the unique id of the parent campaign (currently only valid for rss children)
|
1526
|
+
# - [String] tests_sent tests sent
|
1527
|
+
# - [String] tests_remain test sends remaining
|
1450
1528
|
# - [Hash] tracking the various tracking options used
|
1451
1529
|
# - [Boolean] html_clicks whether or not tracking for html clicks was enabled.
|
1452
1530
|
# - [Boolean] text_clicks whether or not tracking for text clicks was enabled.
|
1453
1531
|
# - [Boolean] opens whether or not opens tracking was enabled.
|
1454
1532
|
# - [String] segment_text a string marked-up with HTML explaining the segment used for the campaign in plain English
|
1455
|
-
# - [Array] segment_opts the segment used for the campaign - can be passed to campaigns/segment-test or campaigns/create
|
1456
|
-
# - [Hash]
|
1533
|
+
# - [Array] segment_opts the segment used for the campaign - can be passed to campaigns/segment-test or campaigns/create()
|
1534
|
+
# - [Hash] saved_segment if a saved segment was used (match+conditions returned above):
|
1535
|
+
# - [Hash] id the saved segment id
|
1536
|
+
# - [Hash] type the saved segment type
|
1537
|
+
# - [Hash] name the saved segment name
|
1538
|
+
# - [Hash] type_opts the type-specific options for the campaign - can be passed to campaigns/create()
|
1457
1539
|
# - [Int] comments_total total number of comments left on this campaign
|
1458
1540
|
# - [Int] comments_unread total number of unread comments for this campaign based on the login the apikey belongs to
|
1459
1541
|
# - [Hash] summary if available, the basic aggregate stats returned by reports/summary
|
@@ -1530,8 +1612,9 @@ module Mailchimp
|
|
1530
1612
|
end
|
1531
1613
|
|
1532
1614
|
# Allows one to test their segmentation rules before creating a campaign using them
|
1533
|
-
# @param [String] list_id the list to test segmentation on - get lists using lists()
|
1534
|
-
# @param [Hash] options with 2 keys:
|
1615
|
+
# @param [String] list_id the list to test segmentation on - get lists using lists/list()
|
1616
|
+
# @param [Hash] options with 1 or 2 keys:
|
1617
|
+
# - [String] saved_segment_id a saved segment id from lists/segments() - this will take precendence, otherwise the match+conditions are required.
|
1535
1618
|
# - [String] match controls whether to use AND or OR when applying your options - expects "<strong>any</strong>" (for OR) or "<strong>all</strong>" (for AND)
|
1536
1619
|
# - [Array] conditions of up to 5 structs for different criteria to apply while segmenting. Each criteria row must contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", and "<strong>value</strong>" - and possibly a fourth, "<strong>extra</strong>", based on these definitions:
|
1537
1620
|
# @return [Hash] with a single entry:
|
@@ -1562,7 +1645,7 @@ module Mailchimp
|
|
1562
1645
|
end
|
1563
1646
|
|
1564
1647
|
# Get the HTML template content sections for a campaign. Note that this <strong>will</strong> return very jagged, non-standard results based on the template a campaign is using. You only want to use this if you want to allow editing template sections in your application.
|
1565
|
-
# @param [String] cid the campaign id to get content for (can be gathered using campaigns())
|
1648
|
+
# @param [String] cid the campaign id to get content for (can be gathered using campaigns/list())
|
1566
1649
|
# @return [Hash] content containing all content section for the campaign - section name are dependent upon the template used and thus can't be documented
|
1567
1650
|
def template_content(cid)
|
1568
1651
|
_params = {:cid => cid}
|
@@ -1578,10 +1661,10 @@ module Mailchimp
|
|
1578
1661
|
return @master.call 'campaigns/unschedule', _params
|
1579
1662
|
end
|
1580
1663
|
|
1581
|
-
# Update just about any setting besides type for a campaign that has <em>not</em> been sent. See
|
1664
|
+
# Update just about any setting besides type for a campaign that has <em>not</em> been sent. See campaigns/create() for details. Caveats:<br/><ul class='bullets'> <li>If you set a new list_id, all segmentation options will be deleted and must be re-added.</li> <li>If you set template_id, you need to follow that up by setting it's 'content'</li> <li>If you set segment_opts, you should have tested your options against campaigns/segment-test().</li> <li>To clear/unset segment_opts, pass an empty string or array as the value. Various wrappers may require one or the other.</li> </ul>
|
1582
1665
|
# @param [String] cid the Campaign Id to update
|
1583
|
-
# @param [String] name the parameter name ( see
|
1584
|
-
# @param [Array] value an appropriate set of values for the parameter ( see
|
1666
|
+
# @param [String] name the parameter name ( see campaigns/create() ). This will be that parameter name (options, content, segment_opts) except "type_opts", which will be the name of the type - rss, auto, etc. The campaign "type" can not be changed.
|
1667
|
+
# @param [Array] value an appropriate set of values for the parameter ( see campaigns/create() ). For additional parameters, this is the same value passed to them.
|
1585
1668
|
# @return [Hash] updated campaign details and any errors
|
1586
1669
|
# - [Hash] data the update campaign details - will return same data as single campaign from campaigns/list()
|
1587
1670
|
# - [Array] errors for "options" only - structs containing:
|
@@ -1629,7 +1712,7 @@ module Mailchimp
|
|
1629
1712
|
end
|
1630
1713
|
|
1631
1714
|
# Add VIPs (previously called Golden Monkeys)
|
1632
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1715
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1633
1716
|
# @param [Array] emails an array of up to 50 email address structs to add, each with with one of the following keys
|
1634
1717
|
# - [String] email an email address - for new subscribers obviously this should be used
|
1635
1718
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
@@ -1655,7 +1738,7 @@ module Mailchimp
|
|
1655
1738
|
end
|
1656
1739
|
|
1657
1740
|
# Remove VIPs - this does not affect list membership
|
1658
|
-
# @param [String] id the list id to connect to. Get by calling lists()
|
1741
|
+
# @param [String] id the list id to connect to. Get by calling lists/list()
|
1659
1742
|
# @param [Array] emails an array of up to 50 email address structs to remove, each with with one of the following keys
|
1660
1743
|
# - [String] email an email address - for new subscribers obviously this should be used
|
1661
1744
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
@@ -1703,7 +1786,7 @@ module Mailchimp
|
|
1703
1786
|
end
|
1704
1787
|
|
1705
1788
|
# Get all email addresses that complained about a given campaign
|
1706
|
-
# @param [String] cid the campaign id to pull abuse reports for (can be gathered using campaigns())
|
1789
|
+
# @param [String] cid the campaign id to pull abuse reports for (can be gathered using campaigns/list())
|
1707
1790
|
# @param [Hash] opts various options for controlling returned data
|
1708
1791
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
1709
1792
|
# - [Int] limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
|
@@ -1720,7 +1803,7 @@ module Mailchimp
|
|
1720
1803
|
end
|
1721
1804
|
|
1722
1805
|
# Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary
|
1723
|
-
# @param [String] cid the campaign id to pull advice text for (can be gathered using campaigns())
|
1806
|
+
# @param [String] cid the campaign id to pull advice text for (can be gathered using campaigns/list())
|
1724
1807
|
# @return [Array] of structs for advice on the campaign's performance, each containing:
|
1725
1808
|
# - [String] msg the advice message
|
1726
1809
|
# - [String] type the "type" of the message. one of: negative, positive, or neutral
|
@@ -1730,14 +1813,14 @@ module Mailchimp
|
|
1730
1813
|
end
|
1731
1814
|
|
1732
1815
|
# Retrieve the most recent full bounce message for a specific email address on the given campaign. Messages over 30 days old are subject to being removed
|
1733
|
-
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns())
|
1816
|
+
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns/list())
|
1734
1817
|
# @param [Hash] email a struct with one of the following keys - failing to provide anything will produce an error relating to the email address. Providing multiples and will use the first we see in this same order.
|
1735
1818
|
# - [String] email an email address - this is recommended for this method
|
1736
1819
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
1737
1820
|
# - [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
|
1738
1821
|
# @return [Hash] the full bounce message for this email+campaign along with some extra data.
|
1739
1822
|
# - [String] date date the bounce was received and processed
|
1740
|
-
# - [Hash] member the member record as returned by lists/member-info
|
1823
|
+
# - [Hash] member the member record as returned by lists/member-info()
|
1741
1824
|
# - [String] message the entire bounce message received
|
1742
1825
|
def bounce_message(cid, email)
|
1743
1826
|
_params = {:cid => cid, :email => email}
|
@@ -1745,7 +1828,7 @@ module Mailchimp
|
|
1745
1828
|
end
|
1746
1829
|
|
1747
1830
|
# Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts of data depending on how large the campaign was and how much cruft the bounce provider returned. Also, messages over 30 days old are subject to being removed
|
1748
|
-
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns())
|
1831
|
+
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns/list())
|
1749
1832
|
# @param [Hash] opts various options for controlling returned data
|
1750
1833
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
1751
1834
|
# - [Int] limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
|
@@ -1754,7 +1837,7 @@ module Mailchimp
|
|
1754
1837
|
# - [Int] total that total number of bounce messages for the campaign
|
1755
1838
|
# - [Array] data structs containing the data for this page
|
1756
1839
|
# - [String] date date the bounce was received and processed
|
1757
|
-
# - [Hash] member the member record as returned by lists/member-info
|
1840
|
+
# - [Hash] member the member record as returned by lists/member-info()
|
1758
1841
|
# - [String] message the entire bounce message received
|
1759
1842
|
def bounce_messages(cid, opts=[])
|
1760
1843
|
_params = {:cid => cid, :opts => opts}
|
@@ -1762,7 +1845,7 @@ module Mailchimp
|
|
1762
1845
|
end
|
1763
1846
|
|
1764
1847
|
# Return the list of email addresses that clicked on a given url, and how many times they clicked
|
1765
|
-
# @param [String] cid the campaign id to get click stats for (can be gathered using campaigns())
|
1848
|
+
# @param [String] cid the campaign id to get click stats for (can be gathered using campaigns/list())
|
1766
1849
|
# @param [Int] tid the "tid" for the URL from reports/clicks
|
1767
1850
|
# @param [Hash] opts various options for controlling returned data
|
1768
1851
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
@@ -1772,7 +1855,7 @@ module Mailchimp
|
|
1772
1855
|
# @return [Hash] containing the total records matched and the specific records for this page
|
1773
1856
|
# - [Int] total the total number of records matched
|
1774
1857
|
# - [Array] data structs for each email addresses that click the requested url
|
1775
|
-
# - [Hash] member the member record as returned by lists/member-info
|
1858
|
+
# - [Hash] member the member record as returned by lists/member-info()
|
1776
1859
|
# - [Int] clicks Total number of times the URL was clicked by this email address
|
1777
1860
|
def click_detail(cid, tid, opts=[])
|
1778
1861
|
_params = {:cid => cid, :tid => tid, :opts => opts}
|
@@ -1780,7 +1863,7 @@ module Mailchimp
|
|
1780
1863
|
end
|
1781
1864
|
|
1782
1865
|
# The urls tracked and their click counts for a given campaign.
|
1783
|
-
# @param [String] cid the campaign id to pull stats for (can be gathered using campaigns())
|
1866
|
+
# @param [String] cid the campaign id to pull stats for (can be gathered using campaigns/list())
|
1784
1867
|
# @return [Hash] including:
|
1785
1868
|
# - [Array] total structs for each url tracked for the full campaign
|
1786
1869
|
# - [String] url the url being tracked - urls are tracked individually, so duplicates can exist with vastly different stats
|
@@ -1808,8 +1891,8 @@ module Mailchimp
|
|
1808
1891
|
return @master.call 'reports/clicks', _params
|
1809
1892
|
end
|
1810
1893
|
|
1811
|
-
# Retrieve the Ecommerce Orders tracked by
|
1812
|
-
# @param [String] cid the campaign id to pull orders for for (can be gathered using campaigns())
|
1894
|
+
# Retrieve the Ecommerce Orders tracked by ecomm/order-add()
|
1895
|
+
# @param [String] cid the campaign id to pull orders for for (can be gathered using campaigns/list())
|
1813
1896
|
# @param [Hash] opts various options for controlling returned data
|
1814
1897
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
1815
1898
|
# - [Int] limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
|
@@ -1820,7 +1903,7 @@ module Mailchimp
|
|
1820
1903
|
# - [String] store_id the store id generated by the plugin used to uniquely identify a store
|
1821
1904
|
# - [String] store_name the store name collected by the plugin - often the domain name
|
1822
1905
|
# - [String] order_id the internal order id the store tracked this order by
|
1823
|
-
# - [Hash] member the member record as returned by lists/member-info that received this campaign and is associated with this order
|
1906
|
+
# - [Hash] member the member record as returned by lists/member-info() that received this campaign and is associated with this order
|
1824
1907
|
# - [Double] order_total the order total
|
1825
1908
|
# - [Double] tax_total the total tax for the order (if collected)
|
1826
1909
|
# - [Double] ship_total the shipping total for the order (if collected)
|
@@ -1840,7 +1923,7 @@ module Mailchimp
|
|
1840
1923
|
end
|
1841
1924
|
|
1842
1925
|
# Retrieve the eepurl stats from the web/Twitter mentions for this campaign
|
1843
|
-
# @param [String] cid the campaign id to pull stats for (can be gathered using campaigns())
|
1926
|
+
# @param [String] cid the campaign id to pull stats for (can be gathered using campaigns/list())
|
1844
1927
|
# @return [Hash] containing tweets, retweets, clicks, and referrer related to using the campaign's eepurl
|
1845
1928
|
# - [Hash] twitter various Twitter related stats
|
1846
1929
|
# - [Int] tweets Total number of tweets seen
|
@@ -1873,7 +1956,7 @@ module Mailchimp
|
|
1873
1956
|
end
|
1874
1957
|
|
1875
1958
|
# Given a campaign and email address, return the entire click and open history with timestamps, ordered by time. If you need to dump the full activity for a campaign and/or get incremental results, you should use the <a href="http://apidocs.mailchimp.com/export/1.0/campaignsubscriberactivity.func.php" targret="_new">campaignSubscriberActivity Export API method</a>, <strong>not</strong> this, especially for large campaigns.
|
1876
|
-
# @param [String] cid the campaign id to get stats for (can be gathered using campaigns())
|
1959
|
+
# @param [String] cid the campaign id to get stats for (can be gathered using campaigns/list())
|
1877
1960
|
# @param [Array] emails an array of up to 50 email address struct to retrieve activity information for
|
1878
1961
|
# - [String] email an email address
|
1879
1962
|
# - [String] euid the unique id for an email address (not list related) - the email "id" returned from listMemberInfo, Webhooks, Campaigns, etc.
|
@@ -1892,7 +1975,7 @@ module Mailchimp
|
|
1892
1975
|
# - [String] email the email address added
|
1893
1976
|
# - [String] euid the email unique id
|
1894
1977
|
# - [String] leid the list member's truly unique id
|
1895
|
-
# - [Hash] member the member record as returned by lists/member-info
|
1978
|
+
# - [Hash] member the member record as returned by lists/member-info()
|
1896
1979
|
# - [Array] activity an array of structs containing the activity, including:
|
1897
1980
|
# - [String] action The action name - either open or click
|
1898
1981
|
# - [String] timestamp The date/time of the action (GMT)
|
@@ -1904,38 +1987,38 @@ module Mailchimp
|
|
1904
1987
|
end
|
1905
1988
|
|
1906
1989
|
# Retrieve the list of email addresses that did not open a given campaign
|
1907
|
-
# @param [String] cid the campaign id to get no opens for (can be gathered using campaigns())
|
1990
|
+
# @param [String] cid the campaign id to get no opens for (can be gathered using campaigns/list())
|
1908
1991
|
# @param [Hash] opts various options for controlling returned data
|
1909
1992
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
1910
1993
|
# - [Int] limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
|
1911
1994
|
# @return [Hash] a total of all matching emails and the specific emails for this page
|
1912
1995
|
# - [Int] total the total number of members who didn't open the campaign
|
1913
|
-
# - [Array] data structs for each campaign member matching as returned by lists/member-info
|
1996
|
+
# - [Array] data structs for each campaign member matching as returned by lists/member-info()
|
1914
1997
|
def not_opened(cid, opts=[])
|
1915
1998
|
_params = {:cid => cid, :opts => opts}
|
1916
1999
|
return @master.call 'reports/not-opened', _params
|
1917
2000
|
end
|
1918
2001
|
|
1919
2002
|
# Retrieve the list of email addresses that opened a given campaign with how many times they opened
|
1920
|
-
# @param [String] cid the campaign id to get opens for (can be gathered using campaigns())
|
2003
|
+
# @param [String] cid the campaign id to get opens for (can be gathered using campaigns/list())
|
1921
2004
|
# @param [Hash] opts various options for controlling returned data
|
1922
2005
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
1923
2006
|
# - [Int] limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
|
1924
2007
|
# - [String] sort_field optional the data to sort by - "opened" (order opens occurred, default) or "opens" (total number of opens). Invalid fields will fall back on the default.
|
1925
2008
|
# - [String] sort_dir optional the direct - ASC or DESC. defaults to ASC (case insensitive)
|
1926
|
-
# @return [
|
2009
|
+
# @return [Hash] containing the total records matched and the specific records for this page
|
1927
2010
|
# - [Int] total the total number of records matched
|
1928
2011
|
# - [Array] data structs for the actual opens data, including:
|
1929
|
-
# - [Hash] member the member record as returned by lists/member-info
|
2012
|
+
# - [Hash] member the member record as returned by lists/member-info()
|
1930
2013
|
# - [Int] opens Total number of times the campaign was opened by this email address
|
1931
2014
|
def opened(cid, opts=[])
|
1932
2015
|
_params = {:cid => cid, :opts => opts}
|
1933
2016
|
return @master.call 'reports/opened', _params
|
1934
2017
|
end
|
1935
2018
|
|
1936
|
-
# Get the top 5 performing email domains for this campaign. Users wanting more than 5 should use campaign
|
1937
|
-
# @param [String] cid the campaign id to pull email domain performance for (can be gathered using campaigns())
|
1938
|
-
# @return [Array] domains
|
2019
|
+
# Get the top 5 performing email domains for this campaign. Users wanting more than 5 should use campaign reports/member-activity() or campaignEmailStatsAIMAll() and generate any additional stats they require.
|
2020
|
+
# @param [String] cid the campaign id to pull email domain performance for (can be gathered using campaigns/list())
|
2021
|
+
# @return [Array] domains structs for each email domains and their associated stats
|
1939
2022
|
# - [String] domain Domain name or special "Other" to roll-up stats past 5 domains
|
1940
2023
|
# - [Int] total_sent Total Email across all domains - this will be the same in every row
|
1941
2024
|
# - [Int] emails Number of emails sent to this domain
|
@@ -1955,12 +2038,12 @@ module Mailchimp
|
|
1955
2038
|
end
|
1956
2039
|
|
1957
2040
|
# Retrieve the countries/regions and number of opens tracked for each. Email address are not returned.
|
1958
|
-
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns())
|
2041
|
+
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns/list())
|
1959
2042
|
# @return [Array] an array of country structs where opens occurred
|
1960
2043
|
# - [String] code The ISO3166 2 digit country code
|
1961
2044
|
# - [String] name A version of the country name, if we have it
|
1962
2045
|
# - [Int] opens The total number of opens that occurred in the country
|
1963
|
-
# - [Array] regions
|
2046
|
+
# - [Array] regions structs of data for each sub-region in the country
|
1964
2047
|
# - [String] code An internal code for the region. When this is blank, it indicates we know the country, but not the region
|
1965
2048
|
# - [String] name The name of the region, if we have one. For blank "code" values, this will be "Rest of Country"
|
1966
2049
|
# - [Int] opens The total number of opens that occurred in the country
|
@@ -1970,7 +2053,7 @@ module Mailchimp
|
|
1970
2053
|
end
|
1971
2054
|
|
1972
2055
|
# Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
|
1973
|
-
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns())
|
2056
|
+
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns/list())
|
1974
2057
|
# @return [Array] of structs for analytics we've collected for the passed campaign.
|
1975
2058
|
# - [Int] visits number of visits
|
1976
2059
|
# - [Int] pages number of page views
|
@@ -1991,7 +2074,7 @@ module Mailchimp
|
|
1991
2074
|
end
|
1992
2075
|
|
1993
2076
|
# Get email addresses the campaign was sent to
|
1994
|
-
# @param [String] cid the campaign id to pull members for (can be gathered using campaigns())
|
2077
|
+
# @param [String] cid the campaign id to pull members for (can be gathered using campaigns/list())
|
1995
2078
|
# @param [Hash] opts various options for controlling returned data
|
1996
2079
|
# - [String] status optional the status to pull - one of 'sent', 'hard' (bounce), or 'soft' (bounce). By default, all records are returned
|
1997
2080
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
@@ -1999,7 +2082,7 @@ module Mailchimp
|
|
1999
2082
|
# @return [Hash] a total of all matching emails and the specific emails for this page
|
2000
2083
|
# - [Int] total the total number of members for the campaign and status
|
2001
2084
|
# - [Array] data structs for each campaign member matching
|
2002
|
-
# - [Hash] member the member record as returned by lists/member-info
|
2085
|
+
# - [Hash] member the member record as returned by lists/member-info()
|
2003
2086
|
# - [String] status the status of the send - one of 'sent', 'hard', 'soft'
|
2004
2087
|
# - [String] absplit_group if this was an absplit campaign, one of 'a','b', or 'winner'
|
2005
2088
|
# - [String] tz_group if this was an timewarp campaign the timezone GMT offset the member was included in
|
@@ -2009,7 +2092,7 @@ module Mailchimp
|
|
2009
2092
|
end
|
2010
2093
|
|
2011
2094
|
# Get the URL to a customized <a href="http://eepurl.com/gKmL" target="_blank">VIP Report</a> for the specified campaign and optionally send an email to someone with links to it. Note subsequent calls will overwrite anything already set for the same campign (eg, the password)
|
2012
|
-
# @param [String] cid the campaign id to share a report for (can be gathered using campaigns())
|
2095
|
+
# @param [String] cid the campaign id to share a report for (can be gathered using campaigns/list())
|
2013
2096
|
# @param [Array] opts optional various parameters which can be used to configure the shared report
|
2014
2097
|
# - [String] to_email optional - optional, comma delimited list of email addresses to share the report with - no value means an email will not be sent
|
2015
2098
|
# - [Int] theme_id optional - either a global or a user-specific theme id. Currently this needs to be pulled out of either the Share Report or Cobranding web views by grabbing the "theme" attribute from the list presented.
|
@@ -2025,7 +2108,7 @@ module Mailchimp
|
|
2025
2108
|
end
|
2026
2109
|
|
2027
2110
|
# Retrieve relevant aggregate campaign statistics (opens, bounces, clicks, etc.)
|
2028
|
-
# @param [String] cid the campaign id to pull stats for (can be gathered using campaigns())
|
2111
|
+
# @param [String] cid the campaign id to pull stats for (can be gathered using campaigns/list())
|
2029
2112
|
# @return [Hash] the statistics for this campaign
|
2030
2113
|
# - [Int] syntax_errors Number of email addresses in campaign that had syntactical errors.
|
2031
2114
|
# - [Int] hard_bounces Number of email addresses in campaign that hard bounced.
|
@@ -2045,6 +2128,14 @@ module Mailchimp
|
|
2045
2128
|
# - [Int] unique_likes total number of unique likes (Facebook)
|
2046
2129
|
# - [Int] recipient_likes total number of recipients who liked (Facebook) the campaign
|
2047
2130
|
# - [Int] facebook_likes total number of likes (Facebook) that came from Facebook
|
2131
|
+
# - [Hash] industry Various rates/percentages for the account's selected industry - empty otherwise. These will vary across calls, do not use them for anything important.
|
2132
|
+
# - [String] type the selected industry
|
2133
|
+
# - [Float] open_rate industry open rate
|
2134
|
+
# - [Float] click_rate industry click rate
|
2135
|
+
# - [Float] bounce_rate industry bounce rate
|
2136
|
+
# - [Float] unopen_rate industry unopen rate
|
2137
|
+
# - [Float] unsub_rate industry unsub rate
|
2138
|
+
# - [Float] abuse_rate industry abuse rate
|
2048
2139
|
# - [Hash] absplit If this was an absplit campaign, stats for the A and B groups will be returned - otherwise this is empty
|
2049
2140
|
# - [Int] bounces_a bounces for the A group
|
2050
2141
|
# - [Int] bounces_b bounces for the B group
|
@@ -2085,14 +2176,14 @@ module Mailchimp
|
|
2085
2176
|
end
|
2086
2177
|
|
2087
2178
|
# Get all unsubscribed email addresses for a given campaign
|
2088
|
-
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns())
|
2179
|
+
# @param [String] cid the campaign id to pull bounces for (can be gathered using campaigns/list())
|
2089
2180
|
# @param [Hash] opts various options for controlling returned data
|
2090
2181
|
# - [Int] start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
2091
2182
|
# - [Int] limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 100
|
2092
2183
|
# @return [Hash] a total of all unsubscribed emails and the specific members for this page
|
2093
2184
|
# - [Int] total the total number of unsubscribes for the campaign
|
2094
2185
|
# - [Array] data structs for the email addresses that unsubscribed
|
2095
|
-
# - [String] member the member that unsubscribed as returned by lists/member-info
|
2186
|
+
# - [String] member the member that unsubscribed as returned by lists/member-info()
|
2096
2187
|
# - [String] reason the reason collected for the unsubscribe. If populated, one of 'NORMAL','NOSIGNUP','INAPPROPRIATE','SPAM','OTHER'
|
2097
2188
|
# - [String] reason_text if the reason is OTHER, the text entered.
|
2098
2189
|
def unsubscribes(cid, opts=[])
|
data/lib/mailchimp/errors.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mailchimp-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 4
|
10
|
+
version: 2.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- MailChimp Devs
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-
|
18
|
+
date: 2013-10-17 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: json
|