Version Description
- Change MCAPI wrapper to use a more unique class name, v1.3 of the API, and a much lighter client library
Download this release
Release Info
Developer | mc_jesse |
Plugin | MailChimp List Subscribe Form |
Version | 1.2.2 |
Comparing to | |
See all releases |
Code changes from version 1.2.1 to 1.2.2
- MCAPI.class.php +0 -1604
- mailchimp.php +33 -34
- mailchimp_widget.php +3 -0
- miniMCAPI.class.php +403 -0
- po/mailchimp_i18n-da_DK.mo +0 -0
- po/mailchimp_i18n-da_DK.po +346 -0
- readme.txt +10 -11
MCAPI.class.php
DELETED
@@ -1,1604 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class MCAPI {
|
4 |
-
var $version = "1.2";
|
5 |
-
var $errorMessage;
|
6 |
-
var $errorCode;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Cache the information on the API location on the server
|
10 |
-
*/
|
11 |
-
var $apiUrl;
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Default to a 300 second timeout on server calls
|
15 |
-
*/
|
16 |
-
var $timeout = 300;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Default to a 8K chunk size
|
20 |
-
*/
|
21 |
-
var $chunkSize = 8192;
|
22 |
-
|
23 |
-
/**
|
24 |
-
* Cache the user api_key so we only have to log in once per client instantiation
|
25 |
-
*/
|
26 |
-
var $api_key;
|
27 |
-
|
28 |
-
/**
|
29 |
-
* Cache the user api_key so we only have to log in once per client instantiation
|
30 |
-
*/
|
31 |
-
var $secure = false;
|
32 |
-
|
33 |
-
/**
|
34 |
-
* Connect to the MailChimp API for a given list. All MCAPI calls require login before functioning
|
35 |
-
*
|
36 |
-
* @param string $username_or_apikey Your MailChimp login user name OR apikey - always required
|
37 |
-
* @param string $password Your MailChimp login password - only required when username passed instead of API Key
|
38 |
-
*/
|
39 |
-
function MCAPI($username_or_apikey, $password=null, $secure=false) {
|
40 |
-
//do more "caching" of the uuid for those people that keep instantiating this...
|
41 |
-
$this->secure = $secure;
|
42 |
-
$this->apiUrl = parse_url("http://api.mailchimp.com/" . $this->version . "/?output=php");
|
43 |
-
if ( isset($GLOBALS["mc_api_key"]) && $GLOBALS["mc_api_key"]!="" ){
|
44 |
-
$this->api_key = $GLOBALS["mc_api_key"];
|
45 |
-
} elseif( $username_or_apikey && !$password ){
|
46 |
-
$this->api_key = $GLOBALS["mc_api_key"] = $username_or_apikey;
|
47 |
-
} else {
|
48 |
-
$this->api_key = $this->callServer("login", array("username" => $username_or_apikey, "password" => $password));
|
49 |
-
$GLOBALS["mc_api_key"] = $this->api_key;
|
50 |
-
}
|
51 |
-
}
|
52 |
-
function setTimeout($seconds){
|
53 |
-
if (is_int($seconds)){
|
54 |
-
$this->timeout = $seconds;
|
55 |
-
return true;
|
56 |
-
}
|
57 |
-
}
|
58 |
-
function getTimeout(){
|
59 |
-
return $this->timeout;
|
60 |
-
}
|
61 |
-
function useSecure($val){
|
62 |
-
if ($val===true){
|
63 |
-
$this->secure = true;
|
64 |
-
} else {
|
65 |
-
$this->secure = false;
|
66 |
-
}
|
67 |
-
}
|
68 |
-
|
69 |
-
/**
|
70 |
-
* Unschedule a campaign that is scheduled to be sent in the future
|
71 |
-
*
|
72 |
-
* @section Campaign Related
|
73 |
-
* @example mcapi_campaignUnschedule.php
|
74 |
-
* @example xml-rpc_campaignUnschedule.php
|
75 |
-
*
|
76 |
-
* @param string $cid the id of the campaign to unschedule
|
77 |
-
* @return boolean true on success
|
78 |
-
*/
|
79 |
-
function campaignUnschedule($cid) {
|
80 |
-
$params = array();
|
81 |
-
$params["cid"] = $cid;
|
82 |
-
return $this->callServer("campaignUnschedule", $params);
|
83 |
-
}
|
84 |
-
|
85 |
-
/**
|
86 |
-
* Schedule a campaign to be sent in the future
|
87 |
-
*
|
88 |
-
* @section Campaign Related
|
89 |
-
* @example mcapi_campaignSchedule.php
|
90 |
-
* @example xml-rpc_campaignSchedule.php
|
91 |
-
*
|
92 |
-
* @param string $cid the id of the campaign to schedule
|
93 |
-
* @param string $schedule_time the time to schedule the campaign. For A/B Split "schedule" campaigns, the time for Group A - in YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
|
94 |
-
* @param string $schedule_time_b optional -the time to schedule Group B of an A/B Split "schedule" campaign - in YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
|
95 |
-
* @return boolean true on success
|
96 |
-
*/
|
97 |
-
function campaignSchedule($cid, $schedule_time, $schedule_time_b=NULL) {
|
98 |
-
$params = array();
|
99 |
-
$params["cid"] = $cid;
|
100 |
-
$params["schedule_time"] = $schedule_time;
|
101 |
-
$params["schedule_time_b"] = $schedule_time_b;
|
102 |
-
return $this->callServer("campaignSchedule", $params);
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* Resume sending an AutoResponder or RSS campaign
|
107 |
-
*
|
108 |
-
* @section Campaign Related
|
109 |
-
*
|
110 |
-
* @param string $cid the id of the campaign to pause
|
111 |
-
* @return boolean true on success
|
112 |
-
*/
|
113 |
-
function campaignResume($cid) {
|
114 |
-
$params = array();
|
115 |
-
$params["cid"] = $cid;
|
116 |
-
return $this->callServer("campaignResume", $params);
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* Pause an AutoResponder orRSS campaign from sending
|
121 |
-
*
|
122 |
-
* @section Campaign Related
|
123 |
-
*
|
124 |
-
* @param string $cid the id of the campaign to pause
|
125 |
-
* @return boolean true on success
|
126 |
-
*/
|
127 |
-
function campaignPause($cid) {
|
128 |
-
$params = array();
|
129 |
-
$params["cid"] = $cid;
|
130 |
-
return $this->callServer("campaignPause", $params);
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Send a given campaign immediately
|
135 |
-
*
|
136 |
-
* @section Campaign Related
|
137 |
-
*
|
138 |
-
* @example mcapi_campaignSendNow.php
|
139 |
-
* @example xml-rpc_campaignSendNow.php
|
140 |
-
*
|
141 |
-
* @param string $cid the id of the campaign to resume
|
142 |
-
* @return boolean true on success
|
143 |
-
*/
|
144 |
-
function campaignSendNow($cid) {
|
145 |
-
$params = array();
|
146 |
-
$params["cid"] = $cid;
|
147 |
-
return $this->callServer("campaignSendNow", $params);
|
148 |
-
}
|
149 |
-
|
150 |
-
/**
|
151 |
-
* Send a test of this campaign to the provided email address
|
152 |
-
*
|
153 |
-
* @section Campaign Related
|
154 |
-
*
|
155 |
-
* @example mcapi_campaignSendTest.php
|
156 |
-
* @example xml-rpc_campaignSendTest.php
|
157 |
-
*
|
158 |
-
* @param string $cid the id of the campaign to test
|
159 |
-
* @param array $test_emails an array of email address to receive the test message
|
160 |
-
* @param string $send_type optional by default (null) both formats are sent - "html" or "text" send just that format
|
161 |
-
* @return boolean true on success
|
162 |
-
*/
|
163 |
-
function campaignSendTest($cid, $test_emails=array (
|
164 |
-
), $send_type=NULL) {
|
165 |
-
$params = array();
|
166 |
-
$params["cid"] = $cid;
|
167 |
-
$params["test_emails"] = $test_emails;
|
168 |
-
$params["send_type"] = $send_type;
|
169 |
-
return $this->callServer("campaignSendTest", $params);
|
170 |
-
}
|
171 |
-
|
172 |
-
/**
|
173 |
-
* Retrieve all templates defined for your user account
|
174 |
-
*
|
175 |
-
* @section Campaign Related
|
176 |
-
* @example mcapi_campaignTemplates.php
|
177 |
-
* @example xml-rpc_campaignTemplates.php
|
178 |
-
*
|
179 |
-
* @return array An array of structs, one for each template (see Returned Fields for details)
|
180 |
-
* @returnf integer id Id of the template
|
181 |
-
* @returnf string name Name of the template
|
182 |
-
* @returnf string layout Layout of the template - "basic", "left_column", "right_column", or "postcard"
|
183 |
-
* @returnf array sections associative array of editable sections in the template that can accept custom HTML when sending a campaign
|
184 |
-
*/
|
185 |
-
function campaignTemplates() {
|
186 |
-
$params = array();
|
187 |
-
return $this->callServer("campaignTemplates", $params);
|
188 |
-
}
|
189 |
-
|
190 |
-
/**
|
191 |
-
* Allows one to test their segmentation rules before creating a campaign using them
|
192 |
-
*
|
193 |
-
* @section Campaign Related
|
194 |
-
* @example mcapi_campaignSegmentTest.php
|
195 |
-
* @example xml-rpc_campaignSegmentTest.php
|
196 |
-
*
|
197 |
-
* @param string $list_id the list to test segmentation on - get lists using lists()
|
198 |
-
* @param array $options with 2 keys:
|
199 |
-
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)
|
200 |
-
array "conditions" - up to 10 different criteria to apply while segmenting. Each criteria row should contain 3 keys - "<strong>field</strong>", "<strong>op</strong>", or "<strong>value</strong>" based on these definitions:
|
201 |
-
|
202 |
-
Field = "<strong>date</strong>" : Select based on various dates we track
|
203 |
-
Valid Op(eration): <strong>eq</strong> (is) / <strong>gt</strong> (after) / <strong>lt</strong> (before)
|
204 |
-
Valid Values:
|
205 |
-
string last_campaign_sent uses the date of the last campaign sent
|
206 |
-
string campaign_id - uses the send date of the campaign that carriers the Id submitted - see campaigns()
|
207 |
-
string YYYY-MM-DD - ny date in the form of YYYY-MM-DD - <em>note:</em> anything that appears to start with YYYY will be treated as a date
|
208 |
-
|
209 |
-
Field = "<strong>interests</strong>":
|
210 |
-
Valid Op(erations): <strong>one</strong> / <strong>none</strong> / <strong>all</strong>
|
211 |
-
Valid Values: a comma delimited of interest groups for the list - see listInterestGroups()
|
212 |
-
|
213 |
-
Field = "<strong>aim</strong>"
|
214 |
-
Valid Op(erations): <strong>open</strong> / <strong>noopen</strong> / <strong>click</strong> / <strong>noclick</strong>
|
215 |
-
Valid Values: "<strong>any</strong>" or a valid AIM-enabled Campaign that has been sent
|
216 |
-
|
217 |
-
Default Field = A Merge Var. Use <strong>Merge0-Merge30</strong> or the <strong>Custom Tag</strong> you've setup for your merge field - see listMergeVars()
|
218 |
-
Valid Op(erations):
|
219 |
-
<strong>eq</strong> (=)/<strong>ne</strong>(!=)/<strong>gt</strong>(>)/<strong>lt</strong>(<)/<strong>like</strong>(like '%blah%')/<strong>nlike</strong>(not like '%blah%')/<strong>starts</strong>(like 'blah%')/<strong>ends</strong>(like '%blah')
|
220 |
-
Valid Values: any string
|
221 |
-
* @return integer total The total number of subscribers matching your segmentation options
|
222 |
-
*/
|
223 |
-
function campaignSegmentTest($list_id, $options) {
|
224 |
-
$params = array();
|
225 |
-
$params["list_id"] = $list_id;
|
226 |
-
$params["options"] = $options;
|
227 |
-
return $this->callServer("campaignSegmentTest", $params);
|
228 |
-
}
|
229 |
-
|
230 |
-
/**
|
231 |
-
* Create a new draft campaign to send
|
232 |
-
*
|
233 |
-
* @section Campaign Related
|
234 |
-
* @example mcapi_campaignCreate.php
|
235 |
-
* @example xml-rpc_campaignCreate.php
|
236 |
-
* @example xml-rpc_campaignCreateABSplit.php
|
237 |
-
* @example xml-rpc_campaignCreateRss.php
|
238 |
-
*
|
239 |
-
* @param string $type the Campaign Type to create - one of "regular", "plaintext", "absplit", "rss", "trans", "auto"
|
240 |
-
* @param array $options a hash of the standard options for this campaign :
|
241 |
-
string list_id the list to send this campaign to- get lists using lists()
|
242 |
-
string subject the subject line for your campaign message
|
243 |
-
string from_email the From: email address for your campaign message
|
244 |
-
string from_name the From: name for your campaign message (not an email address)
|
245 |
-
string to_email the To: name recipients will see (not email address)
|
246 |
-
integer template_id optional - use this template to generate the HTML content of the campaign
|
247 |
-
integer folder_id optional - automatically file the new campaign in the folder_id passed
|
248 |
-
array tracking optional - set which recipient actions will be tracked, as a struct of boolean values with the following keys: "opens", "html_clicks", and "text_clicks". By default, opens and HTML clicks will be tracked.
|
249 |
-
string title optional - an internal name to use for this campaign. By default, the campaign subject will be used.
|
250 |
-
boolean authenticate optional - set to true to enable SenderID, DomainKeys, and DKIM authentication, defaults to false.
|
251 |
-
array analytics optional - if provided, use a struct with "service type" as a key and the "service tag" as a value. For Google, this should be "google"=>"your_google_analytics_key_here". Note that only "google" is currently supported - a Google Analytics tags will be added to all links in the campaign with this string attached. Others may be added in the future
|
252 |
-
boolean auto_footer optional Whether or not we should auto-generate the footer for your content. Mostly useful for content from URLs or Imports
|
253 |
-
boolean inline_css optional Whether or not css should be automatically inlined when this campaign is sent, defaults to false.
|
254 |
-
boolean generate_text optional Whether of not to auto-generate your Text content from the HTML content. Note that this will be ignored if the Text part of the content passed is not empty, defaults to false.
|
255 |
-
|
256 |
-
* @param array $content the content for this campaign - use a struct with the following keys:
|
257 |
-
"html" for pasted HTML content
|
258 |
-
"text" for the plain-text version
|
259 |
-
"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
|
260 |
-
"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
|
261 |
-
"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
|
262 |
-
|
263 |
-
|
264 |
-
If you chose a template instead of pasting in your HTML content, then use "html_" followed by the template sections as keys - for example, use a key of "html_MAIN" to fill in the "MAIN" section of a template. Supported template sections include: "html_HEADER", "html_MAIN", "html_SIDECOLUMN", and "html_FOOTER"
|
265 |
-
* @param array $segment_opts optional - if you wish to do Segmentation with this campaign this array should contain: see campaignSegmentTest(). It's suggested that you test your options against campaignSegmentTest(). Also, "trans" campaigns <strong>do not</strong> support segmentation.
|
266 |
-
* @param array $type_opts optional -
|
267 |
-
For RSS Campaigns this, array should contain:
|
268 |
-
string url the URL to pull RSS content from - it will be verified and must exist
|
269 |
-
|
270 |
-
For A/B Split campaigns, this array should contain:
|
271 |
-
string split_test The values to segment based on. Currently, one of: "subject", "from_name", "schedule". NOTE, for "schedule", you will need to call campaignSchedule() separately!
|
272 |
-
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)
|
273 |
-
integer wait_units optional the default time unit to wait before auto-selecting a winner - use "3600" for hours, "86400" for days. Defaults to 86400.
|
274 |
-
integer 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.
|
275 |
-
integer split_size optional this is a percentage of what size the Campaign's List plus any segmentation options results in. "schedule" type forces 50%, all others default to 10%
|
276 |
-
string from_name_a optional sort of, required when split_test is "from_name"
|
277 |
-
string from_name_b optional sort of, required when split_test is "from_name"
|
278 |
-
string from_email_a optional sort of, required when split_test is "from_name"
|
279 |
-
string from_email_b optional sort of, required when split_test is "from_name"
|
280 |
-
string subject_a optional sort of, required when split_test is "subject"
|
281 |
-
string subject_b optional sort of, required when split_test is "subject"
|
282 |
-
|
283 |
-
For AutoResponder campaigns, this array should contain:
|
284 |
-
string offset-units one of "day", "week", "month", "year" - required
|
285 |
-
string offset-time the number of units, must be a number greater than 0 - required
|
286 |
-
string offset-dir either "before" or "after"
|
287 |
-
string event optional "signup" (default) to base this on double-optin signup, "date" or "annual" to base this on merge field in the list
|
288 |
-
string event-datemerge optional sort of, this is required if the event is "date" or "annual"
|
289 |
-
|
290 |
-
*
|
291 |
-
* @return string the ID for the created campaign
|
292 |
-
*/
|
293 |
-
function campaignCreate($type, $options, $content, $segment_opts=NULL, $type_opts=NULL) {
|
294 |
-
$params = array();
|
295 |
-
$params["type"] = $type;
|
296 |
-
$params["options"] = $options;
|
297 |
-
$params["content"] = $content;
|
298 |
-
$params["segment_opts"] = $segment_opts;
|
299 |
-
$params["type_opts"] = $type_opts;
|
300 |
-
return $this->callServer("campaignCreate", $params);
|
301 |
-
}
|
302 |
-
|
303 |
-
/** Update just about any setting for a campaign that has <em>not</em> been sent. See campaignCreate() for details
|
304 |
-
*
|
305 |
-
* Caveats:<br/><ul>
|
306 |
-
* <li>If you set list_id, all segmentation options will be deleted and must be re-added.</li>
|
307 |
-
* <li>If you set template_id, you need to follow that up by setting it's 'content'</li>
|
308 |
-
* <li>If you set segment_opts, you should have tested your options against campaignSegmentTest() as campaignUpdate() will not allow you to set a segment that includes no members.</li></ul>
|
309 |
-
* @section Campaign Related
|
310 |
-
*
|
311 |
-
* @example mcapi_campaignUpdate.php
|
312 |
-
* @example mcapi_campaignUpdateAB.php
|
313 |
-
* @example xml-rpc_campaignUpdate.php
|
314 |
-
* @example xml-rpc_campaignUpdateAB.php
|
315 |
-
*
|
316 |
-
* @param string $cid the Campaign Id to update
|
317 |
-
* @param string $name the parameter name ( see campaignCreate() )
|
318 |
-
* @param mixed $value an appropriate value for the parameter ( see campaignCreate() )
|
319 |
-
* @return boolean true if the update succeeds, otherwise an error will be thrown
|
320 |
-
*/
|
321 |
-
function campaignUpdate($cid, $name, $value) {
|
322 |
-
$params = array();
|
323 |
-
$params["cid"] = $cid;
|
324 |
-
$params["name"] = $name;
|
325 |
-
$params["value"] = $value;
|
326 |
-
return $this->callServer("campaignUpdate", $params);
|
327 |
-
}
|
328 |
-
|
329 |
-
/** Replicate a campaign.
|
330 |
-
*
|
331 |
-
* @section Campaign Related
|
332 |
-
*
|
333 |
-
* @example mcapi_campaignReplicate.php
|
334 |
-
*
|
335 |
-
* @param string $cid the Campaign Id to replicate
|
336 |
-
* @return string the id of the replicated Campaign created, otherwise an error will be thrown
|
337 |
-
*/
|
338 |
-
function campaignReplicate($cid) {
|
339 |
-
$params = array();
|
340 |
-
$params["cid"] = $cid;
|
341 |
-
return $this->callServer("campaignReplicate", $params);
|
342 |
-
}
|
343 |
-
|
344 |
-
/** Delete a campaign. Seriously, "poof, gone!" - be careful!
|
345 |
-
*
|
346 |
-
* @section Campaign Related
|
347 |
-
*
|
348 |
-
* @example mcapi_campaignDelete.php
|
349 |
-
*
|
350 |
-
* @param string $cid the Campaign Id to delete
|
351 |
-
* @return boolean true if the delete succeeds, otherwise an error will be thrown
|
352 |
-
*/
|
353 |
-
function campaignDelete($cid) {
|
354 |
-
$params = array();
|
355 |
-
$params["cid"] = $cid;
|
356 |
-
return $this->callServer("campaignDelete", $params);
|
357 |
-
}
|
358 |
-
|
359 |
-
/**
|
360 |
-
* Get the list of campaigns and their details matching the specified filters
|
361 |
-
*
|
362 |
-
* @section Campaign Related
|
363 |
-
* @example mcapi_campaigns.php
|
364 |
-
* @example xml-rpc_campaigns.php
|
365 |
-
*
|
366 |
-
* @param array $filters a hash of filters to apply to this query - all are optional:
|
367 |
-
string campaign_id optional - return a single campaign using a know campaign_id
|
368 |
-
string list_id optional - the list to send this campaign to- get lists using lists()
|
369 |
-
integer folder_id optional - only show campaigns from this folder id - get folders using campaignFolders()
|
370 |
-
string type optional - return campaigns of a specific type - one of "regular", "plaintext", "absplit", "rss", "trans", "auto"
|
371 |
-
string from_name optional - only show campaigns that have this "From Name"
|
372 |
-
string from_email optional - only show campaigns that have this "Reply-to Email"
|
373 |
-
string title optional - only show campaigns that have this title
|
374 |
-
string subject optional - only show campaigns that have this subject
|
375 |
-
string sendtime_start optional - only show campaigns that have been sent since this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr)
|
376 |
-
string sendtime_end optional - only show campaigns that have been sent before this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr)
|
377 |
-
boolean exact optional - flag for whether to filter on exact values when filtering, or search within content for filter values - defaults to true
|
378 |
-
* @param integer $start optional - control paging of campaigns, start results at this campaign #, defaults to 1st page of data (page 0)
|
379 |
-
* @param integer $limit optional - control paging of campaigns, number of campaigns to return with each call, defaults to 25 (max=1000)
|
380 |
-
* @return array list of campaigns and their associated information (see Returned Fields for description)
|
381 |
-
* @returnf string id Campaign Id (used for all other campaign functions)
|
382 |
-
* @returnf integer web_id The Campaign id used in our web app, allows you to create a link directly to it
|
383 |
-
* @returnf string title Title of the campaign
|
384 |
-
* @returnf string type The type of campaign this is (regular,plaintext,absplit,rss,inspection,trans,auto)
|
385 |
-
* @returnf date create_time Creation time for the campaign
|
386 |
-
* @returnf date send_time Send time for the campaign
|
387 |
-
* @returnf integer emails_sent Number of emails email was sent to
|
388 |
-
* @returnf string status Status of the given campaign (save,paused,schedule,sending,sent)
|
389 |
-
* @returnf string from_name From name of the given campaign
|
390 |
-
* @returnf string from_email Reply-to email of the given campaign
|
391 |
-
* @returnf string subject Subject of the given campaign
|
392 |
-
* @returnf string to_email Custom "To:" email string using merge variables
|
393 |
-
* @returnf string archive_url Archive link for the given campaign
|
394 |
-
* @returnf boolean inline_css Whether or not the campaigns content auto-css-lined
|
395 |
-
* @returnf string analytics Either "google" if enabled or "N" if disabled
|
396 |
-
* @returnf string analytcs_tag The name/tag the campaign's links were tagged with if analytics were enabled.
|
397 |
-
* @returnf boolean track_clicks_text Whether or not links in the text version of the campaign were tracked
|
398 |
-
* @returnf boolean track_clicks_html Whether or not links in the html version of the campaign were tracked
|
399 |
-
* @returnf boolean track_opens Whether or not opens for the campaign were tracked
|
400 |
-
*/
|
401 |
-
function campaigns($filters=array (
|
402 |
-
), $start=0, $limit=25) {
|
403 |
-
$params = array();
|
404 |
-
$params["filters"] = $filters;
|
405 |
-
$params["start"] = $start;
|
406 |
-
$params["limit"] = $limit;
|
407 |
-
return $this->callServer("campaigns", $params);
|
408 |
-
}
|
409 |
-
|
410 |
-
/**
|
411 |
-
* List all the folders for a user account
|
412 |
-
*
|
413 |
-
* @section Campaign Related
|
414 |
-
* @example mcapi_campaignFolders.php
|
415 |
-
* @example xml-rpc_campaignFolders.php
|
416 |
-
*
|
417 |
-
* @return array Array of folder structs (see Returned Fields for details)
|
418 |
-
* @returnf integer folder_id Folder Id for the given folder, this can be used in the campaigns() function to filter on.
|
419 |
-
* @returnf string name Name of the given folder
|
420 |
-
*/
|
421 |
-
function campaignFolders() {
|
422 |
-
$params = array();
|
423 |
-
return $this->callServer("campaignFolders", $params);
|
424 |
-
}
|
425 |
-
|
426 |
-
/**
|
427 |
-
* Given a list and a campaign, get all the relevant campaign statistics (opens, bounces, clicks, etc.)
|
428 |
-
*
|
429 |
-
* @section Campaign Stats
|
430 |
-
*
|
431 |
-
* @example mcapi_campaignStats.php
|
432 |
-
* @example xml-rpc_campaignStats.php
|
433 |
-
*
|
434 |
-
* @param string $cid the campaign id to pull stats for (can be gathered using campaigns())
|
435 |
-
* @return array struct of the statistics for this campaign
|
436 |
-
* @returnf integer syntax_errors Number of email addresses in campaign that had syntactical errors.
|
437 |
-
* @returnf integer hard_bounces Number of email addresses in campaign that hard bounced.
|
438 |
-
* @returnf integer soft_bounces Number of email addresses in campaign that soft bounced.
|
439 |
-
* @returnf integer unsubscribes Number of email addresses in campaign that unsubscribed.
|
440 |
-
* @returnf integer abuse_reports Number of email addresses in campaign that reported campaign for abuse.
|
441 |
-
* @returnf integer forwards Number of times email was forwarded to a friend.
|
442 |
-
* @returnf integer forwards_opens Number of times a forwarded email was opened.
|
443 |
-
* @returnf integer opens Number of times the campaign was opened.
|
444 |
-
* @returnf date last_open Date of the last time the email was opened.
|
445 |
-
* @returnf integer unique_opens Number of people who opened the campaign.
|
446 |
-
* @returnf integer clicks Number of times a link in the campaign was clicked.
|
447 |
-
* @returnf integer unique_clicks Number of unique recipient/click pairs for the campaign.
|
448 |
-
* @returnf date last_click Date of the last time a link in the email was clicked.
|
449 |
-
* @returnf integer users_who_clicked Number of unique recipients who clicked on a link in the campaign.
|
450 |
-
* @returnf integer emails_sent Number of email addresses campaign was sent to.
|
451 |
-
*/
|
452 |
-
function campaignStats($cid) {
|
453 |
-
$params = array();
|
454 |
-
$params["cid"] = $cid;
|
455 |
-
return $this->callServer("campaignStats", $params);
|
456 |
-
}
|
457 |
-
|
458 |
-
/**
|
459 |
-
* Get an array of the urls being tracked, and their click counts for a given campaign
|
460 |
-
*
|
461 |
-
* @section Campaign Stats
|
462 |
-
*
|
463 |
-
* @example mcapi_campaignClickStats.php
|
464 |
-
* @example xml-rpc_campaignClickStats.php
|
465 |
-
*
|
466 |
-
* @param string $cid the campaign id to pull stats for (can be gathered using campaigns())
|
467 |
-
* @return struct urls will be keys and contain their associated statistics:
|
468 |
-
* @returnf integer clicks Number of times the specific link was clicked
|
469 |
-
* @returnf integer unique Number of unique people who clicked on the specific link
|
470 |
-
*/
|
471 |
-
function campaignClickStats($cid) {
|
472 |
-
$params = array();
|
473 |
-
$params["cid"] = $cid;
|
474 |
-
return $this->callServer("campaignClickStats", $params);
|
475 |
-
}
|
476 |
-
|
477 |
-
/**
|
478 |
-
* Get the top 5 performing email domains for this campaign. Users want more than 5 should use campaign campaignEmailStatsAIM()
|
479 |
-
* or campaignEmailStatsAIMAll() and generate any additional stats they require.
|
480 |
-
*
|
481 |
-
* @section Campaign Stats
|
482 |
-
*
|
483 |
-
* @example mcapi_campaignEmailDomainPerformance.php
|
484 |
-
*
|
485 |
-
* @param string $cid the campaign id to pull email domain performance for (can be gathered using campaigns())
|
486 |
-
* @return array domains email domains and their associated stats
|
487 |
-
* @returnf string domain Domain name or special "Other" to roll-up stats past 5 domains
|
488 |
-
* @returnf integer total_sent Total Email across all domains - this will be the same in every row
|
489 |
-
* @returnf integer emails Number of emails sent to this domain
|
490 |
-
* @returnf integer bounces Number of bounces
|
491 |
-
* @returnf integer opens Number of opens
|
492 |
-
* @returnf integer clicks Number of clicks
|
493 |
-
* @returnf integer unsubs Number of unsubs
|
494 |
-
* @returnf integer delivered Number of deliveries
|
495 |
-
* @returnf integer emails_pct Percentage of emails that went to this domain (whole number)
|
496 |
-
* @returnf integer bounces_pct Percentage of bounces from this domain (whole number)
|
497 |
-
* @returnf integer opens_pct Percentage of opens from this domain (whole number)
|
498 |
-
* @returnf integer clicks_pct Percentage of clicks from this domain (whole number)
|
499 |
-
* @returnf integer unsubs_pct Percentage of unsubs from this domain (whole number)
|
500 |
-
*/
|
501 |
-
function campaignEmailDomainPerformance($cid) {
|
502 |
-
$params = array();
|
503 |
-
$params["cid"] = $cid;
|
504 |
-
return $this->callServer("campaignEmailDomainPerformance", $params);
|
505 |
-
}
|
506 |
-
|
507 |
-
/**
|
508 |
-
* Get all email addresses with Hard Bounces for a given campaign
|
509 |
-
*
|
510 |
-
* @section Campaign Stats
|
511 |
-
*
|
512 |
-
* @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
|
513 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
514 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
|
515 |
-
* @return array Arrays of email addresses with Hard Bounces
|
516 |
-
*/
|
517 |
-
function campaignHardBounces($cid, $start=0, $limit=1000) {
|
518 |
-
$params = array();
|
519 |
-
$params["cid"] = $cid;
|
520 |
-
$params["start"] = $start;
|
521 |
-
$params["limit"] = $limit;
|
522 |
-
return $this->callServer("campaignHardBounces", $params);
|
523 |
-
}
|
524 |
-
|
525 |
-
/**
|
526 |
-
* Get all email addresses with Soft Bounces for a given campaign
|
527 |
-
*
|
528 |
-
* @section Campaign Stats
|
529 |
-
*
|
530 |
-
* @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
|
531 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
532 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
|
533 |
-
* @return array Arrays of email addresses with Soft Bounces
|
534 |
-
*/
|
535 |
-
function campaignSoftBounces($cid, $start=0, $limit=1000) {
|
536 |
-
$params = array();
|
537 |
-
$params["cid"] = $cid;
|
538 |
-
$params["start"] = $start;
|
539 |
-
$params["limit"] = $limit;
|
540 |
-
return $this->callServer("campaignSoftBounces", $params);
|
541 |
-
}
|
542 |
-
|
543 |
-
/**
|
544 |
-
* Get all unsubscribed email addresses for a given campaign
|
545 |
-
*
|
546 |
-
* @section Campaign Stats
|
547 |
-
*
|
548 |
-
* @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
|
549 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
550 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
|
551 |
-
* @return array list of email addresses that unsubscribed from this campaign
|
552 |
-
*/
|
553 |
-
function campaignUnsubscribes($cid, $start=0, $limit=1000) {
|
554 |
-
$params = array();
|
555 |
-
$params["cid"] = $cid;
|
556 |
-
$params["start"] = $start;
|
557 |
-
$params["limit"] = $limit;
|
558 |
-
return $this->callServer("campaignUnsubscribes", $params);
|
559 |
-
}
|
560 |
-
|
561 |
-
/**
|
562 |
-
* Get all email addresses that complained about a given campaign
|
563 |
-
*
|
564 |
-
* @section Campaign Stats
|
565 |
-
*
|
566 |
-
* @example mcapi_campaignAbuseReports.php
|
567 |
-
*
|
568 |
-
* @param string $cid the campaign id to pull abuse reports for (can be gathered using campaigns())
|
569 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
570 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 500, upper limit set at 1000
|
571 |
-
* @param string $since optional pull only messages since this time - use YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
|
572 |
-
* @return array reports the abuse reports for this campaign
|
573 |
-
* @returnf string date date/time the abuse report was received and processed
|
574 |
-
* @returnf string email the email address that reported abuse
|
575 |
-
* @returnf string type an internal type generally specifying the orginating mail provider - may not be useful outside of filling report views
|
576 |
-
*/
|
577 |
-
function campaignAbuseReports($cid, $since=NULL, $start=0, $limit=500) {
|
578 |
-
$params = array();
|
579 |
-
$params["cid"] = $cid;
|
580 |
-
$params["since"] = $since;
|
581 |
-
$params["start"] = $start;
|
582 |
-
$params["limit"] = $limit;
|
583 |
-
return $this->callServer("campaignAbuseReports", $params);
|
584 |
-
}
|
585 |
-
|
586 |
-
/**
|
587 |
-
* Retrieve the text presented in our app for how a campaign performed and any advice we may have for you - best
|
588 |
-
* suited for display in customized reports pages. Note: some messages will contain HTML - clean tags as necessary
|
589 |
-
*
|
590 |
-
* @section Campaign Stats
|
591 |
-
*
|
592 |
-
* @example mcapi_campaignAdvice.php
|
593 |
-
*
|
594 |
-
* @param string $cid the campaign id to pull advice text for (can be gathered using campaigns())
|
595 |
-
* @return array advice on the campaign's performance
|
596 |
-
* @returnf msg the advice message
|
597 |
-
* @returnf type the "type" of the message. one of: negative, positive, or neutral
|
598 |
-
*/
|
599 |
-
function campaignAdvice($cid) {
|
600 |
-
$params = array();
|
601 |
-
$params["cid"] = $cid;
|
602 |
-
return $this->callServer("campaignAdvice", $params);
|
603 |
-
}
|
604 |
-
|
605 |
-
/**
|
606 |
-
* Retrieve the Google Analytics data we've collected for this campaign. Note, requires Google Analytics Add-on to be installed and configured.
|
607 |
-
*
|
608 |
-
* @section Campaign Stats
|
609 |
-
*
|
610 |
-
* @example mcapi_campaignAnalytics.php
|
611 |
-
*
|
612 |
-
* @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
|
613 |
-
* @return array analytics we've collected for the passed campaign.
|
614 |
-
* @returnf integer visits number of visits
|
615 |
-
* @returnf integer pages number of page views
|
616 |
-
* @returnf integer new_visits new visits recorded
|
617 |
-
* @returnf integer bounces vistors who "bounced" from your site
|
618 |
-
* @returnf double time_on_site
|
619 |
-
* @returnf integer goal_conversions number of goals converted
|
620 |
-
* @returnf double goal_value value of conversion in dollars
|
621 |
-
* @returnf double revenue revenue generated by campaign
|
622 |
-
* @returnf integer transactions number of transactions tracked
|
623 |
-
* @returnf integer ecomm_conversions number Ecommerce transactions tracked
|
624 |
-
* @returnf array goals an array containing goal names and number of conversions
|
625 |
-
*/
|
626 |
-
function campaignAnalytics($cid) {
|
627 |
-
$params = array();
|
628 |
-
$params["cid"] = $cid;
|
629 |
-
return $this->callServer("campaignAnalytics", $params);
|
630 |
-
}
|
631 |
-
|
632 |
-
/**
|
633 |
-
* Retrieve the full bounce messages for the given campaign. Note that this can return very large amounts
|
634 |
-
* of data depending on how large the campaign was and how much cruft the bounce provider returned. Also,
|
635 |
-
* message over 30 days old are subject to being removed
|
636 |
-
*
|
637 |
-
* @section Campaign Stats
|
638 |
-
*
|
639 |
-
* @example mcapi_campaignBounceMessages.php
|
640 |
-
*
|
641 |
-
* @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
|
642 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
643 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 25, upper limit set at 50
|
644 |
-
* @param string $since optional pull only messages since this time - use YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
|
645 |
-
* @return array bounces the full bounce messages for this campaign
|
646 |
-
* @returnf string date date/time the bounce was received and processed
|
647 |
-
* @returnf string email the email address that bounced
|
648 |
-
* @returnf string message the entire bounce message received
|
649 |
-
*/
|
650 |
-
function campaignBounceMessages($cid, $start=0, $limit=25, $since=NULL) {
|
651 |
-
$params = array();
|
652 |
-
$params["cid"] = $cid;
|
653 |
-
$params["start"] = $start;
|
654 |
-
$params["limit"] = $limit;
|
655 |
-
$params["since"] = $since;
|
656 |
-
return $this->callServer("campaignBounceMessages", $params);
|
657 |
-
}
|
658 |
-
|
659 |
-
/**
|
660 |
-
* Retrieve the Ecommerce Orders tracked by campaignEcommAddOrder()
|
661 |
-
*
|
662 |
-
* @section Campaign Stats
|
663 |
-
*
|
664 |
-
* @param string $cid the campaign id to pull bounces for (can be gathered using campaigns())
|
665 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
666 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 100, upper limit set at 500
|
667 |
-
* @param string $since optional pull only messages since this time - use YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
|
668 |
-
* @return array orders the orders and their details that we've collected for this campaign
|
669 |
-
* @returnf store_id string the store id generated by the plugin used to uniquely identify a store
|
670 |
-
* @returnf store_name string the store name collected by the plugin - often the domain name
|
671 |
-
* @returnf order_id string the internal order id the store tracked this order by
|
672 |
-
* @returnf email string the email address that received this campaign and is associated with this order
|
673 |
-
* @returnf order_total double the order total
|
674 |
-
* @returnf tax_total double the total tax for the order (if collected)
|
675 |
-
* @returnf ship_total double the shipping total for the order (if collected)
|
676 |
-
* @returnf order_date string the date the order was tracked - from the store if possible, otherwise the GMT time we recieved it
|
677 |
-
* @returnf lines array containing detail of the order - product, category, quantity, item cost
|
678 |
-
*/
|
679 |
-
function campaignEcommOrders($cid, $start=0, $limit=100, $since=NULL) {
|
680 |
-
$params = array();
|
681 |
-
$params["cid"] = $cid;
|
682 |
-
$params["start"] = $start;
|
683 |
-
$params["limit"] = $limit;
|
684 |
-
$params["since"] = $since;
|
685 |
-
return $this->callServer("campaignEcommOrders", $params);
|
686 |
-
}
|
687 |
-
|
688 |
-
/**
|
689 |
-
* 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
|
690 |
-
*
|
691 |
-
* @section Campaign Related
|
692 |
-
*
|
693 |
-
* @param string $cid the campaign id to get content for (can be gathered using campaigns())
|
694 |
-
* @param bool $for_archive optional controls whether we return the Archive version (true) or the Raw version (false), defaults to true
|
695 |
-
* @return struct Struct containing all content for the campaign (see Returned Fields for details
|
696 |
-
* @returnf string html The HTML content used for the campgain with merge tags intact
|
697 |
-
* @returnf string text The Text content used for the campgain with merge tags intact
|
698 |
-
*/
|
699 |
-
function campaignContent($cid, $for_archive=true) {
|
700 |
-
$params = array();
|
701 |
-
$params["cid"] = $cid;
|
702 |
-
$params["for_archive"] = $for_archive;
|
703 |
-
return $this->callServer("campaignContent", $params);
|
704 |
-
}
|
705 |
-
|
706 |
-
/**
|
707 |
-
* Retrieve the list of email addresses that opened a given campaign with how many times they opened - note: this AIM function is free and does
|
708 |
-
* not actually require the AIM module to be installed
|
709 |
-
*
|
710 |
-
* @section Campaign AIM
|
711 |
-
*
|
712 |
-
* @param string $cid the campaign id to get opens for (can be gathered using campaigns())
|
713 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
714 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
|
715 |
-
* @return array Array of structs containing email addresses and open counts
|
716 |
-
* @returnf string email Email address that opened the campaign
|
717 |
-
* @returnf integer open_count Total number of times the campaign was opened by this email address
|
718 |
-
*/
|
719 |
-
function campaignOpenedAIM($cid, $start=0, $limit=1000) {
|
720 |
-
$params = array();
|
721 |
-
$params["cid"] = $cid;
|
722 |
-
$params["start"] = $start;
|
723 |
-
$params["limit"] = $limit;
|
724 |
-
return $this->callServer("campaignOpenedAIM", $params);
|
725 |
-
}
|
726 |
-
|
727 |
-
/**
|
728 |
-
* Retrieve the list of email addresses that did not open a given campaign
|
729 |
-
*
|
730 |
-
* @section Campaign AIM
|
731 |
-
*
|
732 |
-
* @param string $cid the campaign id to get no opens for (can be gathered using campaigns())
|
733 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
734 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
|
735 |
-
* @return array list of email addresses that did not open a campaign
|
736 |
-
*/
|
737 |
-
function campaignNotOpenedAIM($cid, $start=0, $limit=1000) {
|
738 |
-
$params = array();
|
739 |
-
$params["cid"] = $cid;
|
740 |
-
$params["start"] = $start;
|
741 |
-
$params["limit"] = $limit;
|
742 |
-
return $this->callServer("campaignNotOpenedAIM", $params);
|
743 |
-
}
|
744 |
-
|
745 |
-
/**
|
746 |
-
* Return the list of email addresses that clicked on a given url, and how many times they clicked
|
747 |
-
*
|
748 |
-
* @section Campaign AIM
|
749 |
-
*
|
750 |
-
* @param string $cid the campaign id to get click stats for (can be gathered using campaigns())
|
751 |
-
* @param string $url the URL of the link that was clicked on
|
752 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
753 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 1000, upper limit set at 15000
|
754 |
-
* @return array Array of structs containing email addresses and click counts
|
755 |
-
* @returnf string email Email address that opened the campaign
|
756 |
-
* @returnf integer clicks Total number of times the URL was clicked on by this email address
|
757 |
-
*/
|
758 |
-
function campaignClickDetailAIM($cid, $url, $start=0, $limit=1000) {
|
759 |
-
$params = array();
|
760 |
-
$params["cid"] = $cid;
|
761 |
-
$params["url"] = $url;
|
762 |
-
$params["start"] = $start;
|
763 |
-
$params["limit"] = $limit;
|
764 |
-
return $this->callServer("campaignClickDetailAIM", $params);
|
765 |
-
}
|
766 |
-
|
767 |
-
/**
|
768 |
-
* Given a campaign and email address, return the entire click and open history with timestamps, ordered by time
|
769 |
-
*
|
770 |
-
* @section Campaign AIM
|
771 |
-
*
|
772 |
-
* @param string $cid the campaign id to get stats for (can be gathered using campaigns())
|
773 |
-
* @return array Array of structs containing the actions (opens and clicks) that the email took, with timestamps
|
774 |
-
* @returnf string action The action taken (open or click)
|
775 |
-
* @returnf date timestamp Time the action occurred
|
776 |
-
* @returnf string url For clicks, the URL that was clicked
|
777 |
-
*/
|
778 |
-
function campaignEmailStatsAIM($cid, $email_address) {
|
779 |
-
$params = array();
|
780 |
-
$params["cid"] = $cid;
|
781 |
-
$params["email_address"] = $email_address;
|
782 |
-
return $this->callServer("campaignEmailStatsAIM", $params);
|
783 |
-
}
|
784 |
-
|
785 |
-
/**
|
786 |
-
* Given a campaign and correct paging limits, return the entire click and open history with timestamps, ordered by time,
|
787 |
-
* for every user a campaign was delivered to.
|
788 |
-
*
|
789 |
-
* @section Campaign AIM
|
790 |
-
* @example mcapi_campaignEmailStatsAIMAll.php
|
791 |
-
*
|
792 |
-
* @param string $cid the campaign id to get stats for (can be gathered using campaigns())
|
793 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
794 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 100, upper limit set at 1000
|
795 |
-
* @return array Array of structs containing actions (opens and clicks) for each email, with timestamps
|
796 |
-
* @returnf string action The action taken (open or click)
|
797 |
-
* @returnf date timestamp Time the action occurred
|
798 |
-
* @returnf string url For clicks, the URL that was clicked
|
799 |
-
*/
|
800 |
-
function campaignEmailStatsAIMAll($cid, $start=0, $limit=100) {
|
801 |
-
$params = array();
|
802 |
-
$params["cid"] = $cid;
|
803 |
-
$params["start"] = $start;
|
804 |
-
$params["limit"] = $limit;
|
805 |
-
return $this->callServer("campaignEmailStatsAIMAll", $params);
|
806 |
-
}
|
807 |
-
|
808 |
-
/**
|
809 |
-
* Attach Ecommerce Order Information to a Campaign. This will generall be used by ecommerce package plugins
|
810 |
-
* <a href="/plugins/ecomm360.phtml">that we provide</a> or by 3rd part system developers.
|
811 |
-
* @section Campaign Related
|
812 |
-
*
|
813 |
-
* @param array $order an array of information pertaining to the order that has completed. Use the following keys:
|
814 |
-
string id the Order Id
|
815 |
-
string campaign_id the Campaign Id to track this order with (see the "mc_cid" query string variable a campaign passes)
|
816 |
-
string email_id the Email Id of the subscriber we should attach this order to (see the "mc_eid" query string variable a campaign passes)
|
817 |
-
double total The Order Total (ie, the full amount the customer ends up paying)
|
818 |
-
double shipping optional the total paid for Shipping Fees
|
819 |
-
double tax optional the total tax paid
|
820 |
-
string store_id a unique id for the store sending the order in
|
821 |
-
string store_name optional a "nice" name for the store - typically the base web address (ie, "store.mailchimp.com"). We will automatically update this if it changes (based on store_id)
|
822 |
-
string plugin_id the MailChimp assigned Plugin Id. Get yours by <a href="/api/register.php">registering here</a>
|
823 |
-
array items the individual line items for an order using these keys:
|
824 |
-
<div style="padding-left:30px"><table><tr><td colspan=*>
|
825 |
-
integer line_num optional the line number of the item on the order. We will generate these if they are not passed
|
826 |
-
integer product_id the store's internal Id for the product. Lines that do no contain this will be skipped
|
827 |
-
string product_name the product name for the product_id associated with this item. We will auto update these as they change (based on product_id)
|
828 |
-
integer category_id the store's internal Id for the (main) category associated with this product. Our testing has found this to be a "best guess" scenario
|
829 |
-
string category_name the category name for the category_id this product is in. Our testing has found this to be a "best guess" scenario. Our plugins walk the category heirarchy up and send "Root - SubCat1 - SubCat4", etc.
|
830 |
-
double qty the quantity of the item ordered
|
831 |
-
double cost the cost of a single item (ie, not the extended cost of the line)
|
832 |
-
</td></tr></table></div>
|
833 |
-
* @return bool true if the data is saved, otherwise an error is thrown.
|
834 |
-
*/
|
835 |
-
function campaignEcommAddOrder($order) {
|
836 |
-
$params = array();
|
837 |
-
$params["order"] = $order;
|
838 |
-
return $this->callServer("campaignEcommAddOrder", $params);
|
839 |
-
}
|
840 |
-
|
841 |
-
/**
|
842 |
-
* Retrieve all of the lists defined for your user account
|
843 |
-
*
|
844 |
-
* @section List Related
|
845 |
-
* @example mcapi_lists.php
|
846 |
-
* @example xml-rpc_lists.php
|
847 |
-
*
|
848 |
-
* @return array list of your Lists and their associated information (see Returned Fields for description)
|
849 |
-
* @returnf string id The list id for this list. This will be used for all other list management functions.
|
850 |
-
* @returnf integer web_id The list id used in our web app, allows you to create a link directly to it
|
851 |
-
* @returnf string name The name of the list.
|
852 |
-
* @returnf date date_created The date that this list was created.
|
853 |
-
* @returnf integer member_count The number of active members in the given list.
|
854 |
-
* @returnf integer unsubscribe_count The number of members who have unsubscribed from the given list.
|
855 |
-
* @returnf integer cleaned_count The number of members cleaned from the given list.
|
856 |
-
* @returnf boolean email_type_option Whether or not the List supports multiple formats for emails or just HTML
|
857 |
-
* @returnf string default_from_name Default From Name for campaigns using this list
|
858 |
-
* @returnf string default_from_email Default From Email for campaigns using this list
|
859 |
-
* @returnf string default_subject Default Subject Line for campaigns using this list
|
860 |
-
* @returnf string default_language Default Language for this list's forms
|
861 |
-
*/
|
862 |
-
function lists() {
|
863 |
-
$params = array();
|
864 |
-
return $this->callServer("lists", $params);
|
865 |
-
}
|
866 |
-
|
867 |
-
/**
|
868 |
-
* Get the list of merge tags for a given list, including their name, tag, and required setting
|
869 |
-
*
|
870 |
-
* @section List Related
|
871 |
-
* @example xml-rpc_listMergeVars.php
|
872 |
-
*
|
873 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
874 |
-
* @return array list of merge tags for the list
|
875 |
-
* @returnf string name Name of the merge field
|
876 |
-
* @returnf char req Denotes whether the field is required (Y) or not (N)
|
877 |
-
* @returnf string tag The merge tag that's used for forms and listSubscribe() and listUpdateMember()
|
878 |
-
*/
|
879 |
-
function listMergeVars($id) {
|
880 |
-
$params = array();
|
881 |
-
$params["id"] = $id;
|
882 |
-
return $this->callServer("listMergeVars", $params);
|
883 |
-
}
|
884 |
-
|
885 |
-
/**
|
886 |
-
* Add a new merge tag to a given list
|
887 |
-
*
|
888 |
-
* @section List Related
|
889 |
-
* @example xml-rpc_listMergeVarAdd.php
|
890 |
-
*
|
891 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
892 |
-
* @param string $tag The merge tag to add, e.g. FNAME
|
893 |
-
* @param string $name The long description of the tag being added, used for user displays
|
894 |
-
* @param array $req optional Various options for this merge var. <em>note:</em> for historical purposes this can also take a "boolean"
|
895 |
-
string field_type optional one of: text, number, radio, dropdownn, date, address, phone, url, imageurl - defaults to text
|
896 |
-
boolean req optional indicates whether the field is required - defaults to false
|
897 |
-
boolean public optional indicates whether the field is displayed in public - defaults to true
|
898 |
-
boolean show optional indicates whether the field is displayed in the app's list member view - defaults to true
|
899 |
-
string default_value optional the default value for the field. See listSubscribe() for formatting info. Defaults to blank
|
900 |
-
array choices optional kind of - an array of strings to use as the choices for radio and dropdown type fields
|
901 |
-
|
902 |
-
* @return bool true if the request succeeds, otherwise an error will be thrown
|
903 |
-
*/
|
904 |
-
function listMergeVarAdd($id, $tag, $name, $req=array (
|
905 |
-
)) {
|
906 |
-
$params = array();
|
907 |
-
$params["id"] = $id;
|
908 |
-
$params["tag"] = $tag;
|
909 |
-
$params["name"] = $name;
|
910 |
-
$params["req"] = $req;
|
911 |
-
return $this->callServer("listMergeVarAdd", $params);
|
912 |
-
}
|
913 |
-
|
914 |
-
/**
|
915 |
-
* Update most parameters for a merge tag on a given list. You cannot currently change the merge type
|
916 |
-
*
|
917 |
-
* @section List Related
|
918 |
-
*
|
919 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
920 |
-
* @param string $tag The merge tag to update
|
921 |
-
* @param array $options The options to change for a merge var. See listMergeVarAdd() for valid options
|
922 |
-
* @return bool true if the request succeeds, otherwise an error will be thrown
|
923 |
-
*/
|
924 |
-
function listMergeVarUpdate($id, $tag, $options) {
|
925 |
-
$params = array();
|
926 |
-
$params["id"] = $id;
|
927 |
-
$params["tag"] = $tag;
|
928 |
-
$params["options"] = $options;
|
929 |
-
return $this->callServer("listMergeVarUpdate", $params);
|
930 |
-
}
|
931 |
-
|
932 |
-
/**
|
933 |
-
* Delete a merge tag from a given list and all its members. Seriously - the data is removed from all members as well!
|
934 |
-
* Note that on large lists this method may seem a bit slower than calls you typically make.
|
935 |
-
*
|
936 |
-
* @section List Related
|
937 |
-
* @example xml-rpc_listMergeVarDel.php
|
938 |
-
*
|
939 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
940 |
-
* @param string $tag The merge tag to delete
|
941 |
-
* @return bool true if the request succeeds, otherwise an error will be thrown
|
942 |
-
*/
|
943 |
-
function listMergeVarDel($id, $tag) {
|
944 |
-
$params = array();
|
945 |
-
$params["id"] = $id;
|
946 |
-
$params["tag"] = $tag;
|
947 |
-
return $this->callServer("listMergeVarDel", $params);
|
948 |
-
}
|
949 |
-
|
950 |
-
/**
|
951 |
-
* Get the list of interest groups for a given list, including the label and form information
|
952 |
-
*
|
953 |
-
* @section List Related
|
954 |
-
* @example xml-rpc_listInterestGroups.php
|
955 |
-
*
|
956 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
957 |
-
* @return struct list of interest groups for the list
|
958 |
-
* @returnf string name Name for the Interest groups
|
959 |
-
* @returnf string form_field Gives the type of interest group: checkbox,radio,select
|
960 |
-
* @returnf array groups Array of the group names
|
961 |
-
*/
|
962 |
-
function listInterestGroups($id) {
|
963 |
-
$params = array();
|
964 |
-
$params["id"] = $id;
|
965 |
-
return $this->callServer("listInterestGroups", $params);
|
966 |
-
}
|
967 |
-
|
968 |
-
/** Add a single Interest Group - if interest groups for the List are not yet enabled, adding the first
|
969 |
-
* group will automatically turn them on.
|
970 |
-
*
|
971 |
-
* @section List Related
|
972 |
-
* @example xml-rpc_listInterestGroupAdd.php
|
973 |
-
*
|
974 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
975 |
-
* @param string $group_name the interest group to add
|
976 |
-
* @return bool true if the request succeeds, otherwise an error will be thrown
|
977 |
-
*/
|
978 |
-
function listInterestGroupAdd($id, $group_name) {
|
979 |
-
$params = array();
|
980 |
-
$params["id"] = $id;
|
981 |
-
$params["group_name"] = $group_name;
|
982 |
-
return $this->callServer("listInterestGroupAdd", $params);
|
983 |
-
}
|
984 |
-
|
985 |
-
/** Delete a single Interest Group - if the last group for a list is deleted, this will also turn groups for the list off.
|
986 |
-
*
|
987 |
-
* @section List Related
|
988 |
-
* @example xml-rpc_listInterestGroupDel.php
|
989 |
-
*
|
990 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
991 |
-
* @param string $group_name the interest group to delete
|
992 |
-
* @return bool true if the request succeeds, otherwise an error will be thrown
|
993 |
-
*/
|
994 |
-
function listInterestGroupDel($id, $group_name) {
|
995 |
-
$params = array();
|
996 |
-
$params["id"] = $id;
|
997 |
-
$params["group_name"] = $group_name;
|
998 |
-
return $this->callServer("listInterestGroupDel", $params);
|
999 |
-
}
|
1000 |
-
|
1001 |
-
/** Change the name of an Interest Group
|
1002 |
-
*
|
1003 |
-
* @section List Related
|
1004 |
-
* @example xml-rpc_listInterestGroupDel.php
|
1005 |
-
*
|
1006 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1007 |
-
* @param string $old_name the interest group name to be changed
|
1008 |
-
* @param string $new_name the new interest group name to be set
|
1009 |
-
* @return bool true if the request succeeds, otherwise an error will be thrown
|
1010 |
-
*/
|
1011 |
-
function listInterestGroupUpdate($id, $old_name, $new_name) {
|
1012 |
-
$params = array();
|
1013 |
-
$params["id"] = $id;
|
1014 |
-
$params["old_name"] = $old_name;
|
1015 |
-
$params["new_name"] = $new_name;
|
1016 |
-
return $this->callServer("listInterestGroupUpdate", $params);
|
1017 |
-
}
|
1018 |
-
|
1019 |
-
/** Return the Webhooks configured for the given list
|
1020 |
-
*
|
1021 |
-
* @section List Related
|
1022 |
-
*
|
1023 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1024 |
-
* @return array list of webhooks
|
1025 |
-
* @returnf string url the URL for this Webhook
|
1026 |
-
* @returnf array actions the possible actions and whether they are enabled
|
1027 |
-
* @returnf array sources the possible sources and whether they are enabled
|
1028 |
-
*/
|
1029 |
-
function listWebhooks($id) {
|
1030 |
-
$params = array();
|
1031 |
-
$params["id"] = $id;
|
1032 |
-
return $this->callServer("listWebhooks", $params);
|
1033 |
-
}
|
1034 |
-
|
1035 |
-
/** Add a new Webhook URL for the given list
|
1036 |
-
*
|
1037 |
-
* @section List Related
|
1038 |
-
*
|
1039 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1040 |
-
* @param string $url a valid URL for the Webhook - it will be validated. note that a url may only exist on a list once.
|
1041 |
-
* @param array $actions optional a hash of actions to fire this Webhook for
|
1042 |
-
boolean subscribe optional as subscribes occur, defaults to true
|
1043 |
-
boolean unsubscribe optional as subscribes occur, defaults to true
|
1044 |
-
boolean profile optional as profile updates occur, defaults to true
|
1045 |
-
boolean cleaned optional as emails are cleaned from the list, defaults to true
|
1046 |
-
boolean upemail optional when subscribers change their email address, defaults to true
|
1047 |
-
* @param array $sources optional a hash of sources to fire this Webhook for
|
1048 |
-
boolean user optional user/subscriber initiated actions, defaults to true
|
1049 |
-
boolean admin optional admin actions in our web app, defaults to true
|
1050 |
-
boolean api optional actions that happen via API calls, defaults to false
|
1051 |
-
* @return bool true if the call succeeds, otherwise an exception will be thrown
|
1052 |
-
*/
|
1053 |
-
function listWebhookAdd($id, $url, $actions=array (
|
1054 |
-
), $sources=array (
|
1055 |
-
)) {
|
1056 |
-
$params = array();
|
1057 |
-
$params["id"] = $id;
|
1058 |
-
$params["url"] = $url;
|
1059 |
-
$params["actions"] = $actions;
|
1060 |
-
$params["sources"] = $sources;
|
1061 |
-
return $this->callServer("listWebhookAdd", $params);
|
1062 |
-
}
|
1063 |
-
|
1064 |
-
/** Delete an existing Webhook URL from a given list
|
1065 |
-
*
|
1066 |
-
* @section List Related
|
1067 |
-
*
|
1068 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1069 |
-
* @param string $url the URL of a Webhook on this list
|
1070 |
-
* @return boolean true if the call succeeds, otherwise an exception will be thrown
|
1071 |
-
*/
|
1072 |
-
function listWebhookDel($id, $url) {
|
1073 |
-
$params = array();
|
1074 |
-
$params["id"] = $id;
|
1075 |
-
$params["url"] = $url;
|
1076 |
-
return $this->callServer("listWebhookDel", $params);
|
1077 |
-
}
|
1078 |
-
|
1079 |
-
/**
|
1080 |
-
* Subscribe the provided email to a list. By default this sends a confirmation email - you will not see new members until the link contained in it is clicked!
|
1081 |
-
*
|
1082 |
-
* @section List Related
|
1083 |
-
*
|
1084 |
-
* @example mcapi_listSubscribe.php
|
1085 |
-
* @example xml-rpc_listSubscribe.php
|
1086 |
-
*
|
1087 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1088 |
-
* @param string $email_address the email address to subscribe
|
1089 |
-
* @param array $merge_vars array of merges for the email (FNAME, LNAME, etc.) (see examples below for handling "blank" arrays). Note that a merge field can only hold up to 255 characters. Also, there are 2 "special" keys:
|
1090 |
-
string INTERESTS Set Interest Groups by passing a field named "INTERESTS" that contains a comma delimited list of Interest Groups to add. Commas in Interest Group names should be escaped with a backslash. ie, "," => "\,"
|
1091 |
-
string OPTINIP Set the Opt-in IP fields. <em>Abusing this may cause your account to be suspended.</em> We do validate this and it must not be a private IP address.
|
1092 |
-
|
1093 |
-
<strong>Handling Field Data Types</strong> - most fields you can just pass a string and all is well. For some, though, that is not the case...
|
1094 |
-
Field values should be formatted as follows:
|
1095 |
-
string address For the string version of an Address, the fields should be delimited by <strong>2</strong> spaces. Address 2 can be skipped. The Country should be a 2 character ISO-3166-1 code and will default to your default country if not set
|
1096 |
-
array address For the array version of an Address, the requirements for Address 2 and Country are the same as with the string version. Then simply pass us an array with the keys <strong>addr1</strong>, <strong>addr2</strong>, <strong>city</strong>, <strong>state</strong>, <strong>zip</strong>, <strong>country</strong> and appropriate values for each
|
1097 |
-
|
1098 |
-
string date use YYYY-MM-DD to be safe. Generally, though, anything strtotime() understands we'll understand - <a href="http://us2.php.net/strtotime" target="_blank">http://us2.php.net/strtotime</a>
|
1099 |
-
string dropdown can be a normal string - we <em>will</em> validate that the value is a valid option
|
1100 |
-
string image must be a valid, existing url. we <em>will</em> check its existence
|
1101 |
-
string multi_choice can be a normal string - we <em>will</em> validate that the value is a valid option
|
1102 |
-
double number pass in a valid number - anything else will turn in to zero (0). Note, this will be rounded to 2 decimal places
|
1103 |
-
string phone If your account has the US Phone numbers option set, this <em>must</em> be in the form of NPA-NXX-LINE (404-555-1212). If not, we assume an International number and will simply set the field with what ever number is passed in.
|
1104 |
-
string website This is a standard string, but we <em>will</em> verify that it looks like a valid URL
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
* @param string $email_type optional - email type preference for the email (html or text, defaults to html)
|
1109 |
-
* @param boolean $double_optin optional - flag to control whether a double opt-in confirmation message is sent, defaults to true. <em>Abusing this may cause your account to be suspended.</em>
|
1110 |
-
* @param boolean $update_existing optional - flag to control whether a existing subscribers should be updated instead of throwing and error
|
1111 |
-
* @param boolean $replace_interests - flag to determine whether we replace the interest groups with the groups provided, or we add the provided groups to the member's interest groups (optional, defaults to true)
|
1112 |
-
* @param boolean $send_welcome - if your double_optin is false and this is true, we will send your lists Welcome Email if this subscribe succeeds - this will *not* fire if we end up updating an existing subscriber. defaults to false
|
1113 |
-
|
1114 |
-
* @return boolean true on success, false on failure. When using MCAPI.class.php, the value can be tested and error messages pulled from the MCAPI object (see below)
|
1115 |
-
*/
|
1116 |
-
function listSubscribe($id, $email_address, $merge_vars, $email_type='html', $double_optin=true, $update_existing=false, $replace_interests=true, $send_welcome=false) {
|
1117 |
-
$params = array();
|
1118 |
-
$params["id"] = $id;
|
1119 |
-
$params["email_address"] = $email_address;
|
1120 |
-
$params["merge_vars"] = $merge_vars;
|
1121 |
-
$params["email_type"] = $email_type;
|
1122 |
-
$params["double_optin"] = $double_optin;
|
1123 |
-
$params["update_existing"] = $update_existing;
|
1124 |
-
$params["replace_interests"] = $replace_interests;
|
1125 |
-
$params["send_welcome"] = $send_welcome;
|
1126 |
-
return $this->callServer("listSubscribe", $params);
|
1127 |
-
}
|
1128 |
-
|
1129 |
-
/**
|
1130 |
-
* Unsubscribe the given email address from the list
|
1131 |
-
*
|
1132 |
-
* @section List Related
|
1133 |
-
* @example mcapi_listUnsubscribe.php
|
1134 |
-
* @example xml-rpc_listUnsubscribe.php
|
1135 |
-
*
|
1136 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1137 |
-
* @param string $email_address the email address to unsubscribe
|
1138 |
-
* @param boolean $delete_member flag to completely delete the member from your list instead of just unsubscribing, default to false
|
1139 |
-
* @param boolean $send_goodbye flag to send the goodbye email to the email address, defaults to true
|
1140 |
-
* @param boolean $send_notify flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to true
|
1141 |
-
* @return boolean true on success, false on failure. When using MCAPI.class.php, the value can be tested and error messages pulled from the MCAPI object (see below)
|
1142 |
-
*/
|
1143 |
-
function listUnsubscribe($id, $email_address, $delete_member=false, $send_goodbye=true, $send_notify=true) {
|
1144 |
-
$params = array();
|
1145 |
-
$params["id"] = $id;
|
1146 |
-
$params["email_address"] = $email_address;
|
1147 |
-
$params["delete_member"] = $delete_member;
|
1148 |
-
$params["send_goodbye"] = $send_goodbye;
|
1149 |
-
$params["send_notify"] = $send_notify;
|
1150 |
-
return $this->callServer("listUnsubscribe", $params);
|
1151 |
-
}
|
1152 |
-
|
1153 |
-
/**
|
1154 |
-
* Edit the email address, merge fields, and interest groups for a list member
|
1155 |
-
*
|
1156 |
-
* @section List Related
|
1157 |
-
* @example mcapi_listUpdateMember.php
|
1158 |
-
*
|
1159 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1160 |
-
* @param string $email_address the current email address of the member to update
|
1161 |
-
* @param array $merge_vars array of new field values to update the member with. Use "EMAIL" to update the email address and "INTERESTS" to update the interest groups
|
1162 |
-
* @param string $email_type change the email type preference for the member ("html" or "text"). Leave blank to keep the existing preference (optional)
|
1163 |
-
* @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)
|
1164 |
-
* @return boolean true on success, false on failure. When using MCAPI.class.php, the value can be tested and error messages pulled from the MCAPI object
|
1165 |
-
*/
|
1166 |
-
function listUpdateMember($id, $email_address, $merge_vars, $email_type='', $replace_interests=true) {
|
1167 |
-
$params = array();
|
1168 |
-
$params["id"] = $id;
|
1169 |
-
$params["email_address"] = $email_address;
|
1170 |
-
$params["merge_vars"] = $merge_vars;
|
1171 |
-
$params["email_type"] = $email_type;
|
1172 |
-
$params["replace_interests"] = $replace_interests;
|
1173 |
-
return $this->callServer("listUpdateMember", $params);
|
1174 |
-
}
|
1175 |
-
|
1176 |
-
/**
|
1177 |
-
* Subscribe a batch of email addresses to a list at once
|
1178 |
-
*
|
1179 |
-
* @section List Related
|
1180 |
-
*
|
1181 |
-
* @example mcapi_listBatchSubscribe.php
|
1182 |
-
* @example xml-rpc_listBatchSubscribe.php
|
1183 |
-
*
|
1184 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1185 |
-
* @param array $batch an array of structs for each address to import with two special keys: "EMAIL" for the email address, and "EMAIL_TYPE" for the email type option (html or text)
|
1186 |
-
* @param boolean $double_optin flag to control whether to send an opt-in confirmation email - defaults to true
|
1187 |
-
* @param boolean $update_existing flag to control whether to update members that are already subscribed to the list or to return an error, defaults to false (return error)
|
1188 |
-
* @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)
|
1189 |
-
* @return struct Array of result counts and any errors that occurred
|
1190 |
-
* @returnf integer success_count Number of email addresses that were succesfully added/updated
|
1191 |
-
* @returnf integer error_count Number of email addresses that failed during addition/updating
|
1192 |
-
* @returnf array errors Array of error structs. Each error struct will contain "code", "message", and the full struct that failed
|
1193 |
-
*/
|
1194 |
-
function listBatchSubscribe($id, $batch, $double_optin=true, $update_existing=false, $replace_interests=true) {
|
1195 |
-
$params = array();
|
1196 |
-
$params["id"] = $id;
|
1197 |
-
$params["batch"] = $batch;
|
1198 |
-
$params["double_optin"] = $double_optin;
|
1199 |
-
$params["update_existing"] = $update_existing;
|
1200 |
-
$params["replace_interests"] = $replace_interests;
|
1201 |
-
return $this->callServer("listBatchSubscribe", $params);
|
1202 |
-
}
|
1203 |
-
|
1204 |
-
/**
|
1205 |
-
* Unsubscribe a batch of email addresses to a list
|
1206 |
-
*
|
1207 |
-
* @section List Related
|
1208 |
-
* @example mcapi_listBatchUnsubscribe.php
|
1209 |
-
*
|
1210 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1211 |
-
* @param array $emails array of email addresses to unsubscribe
|
1212 |
-
* @param boolean $delete_member flag to completely delete the member from your list instead of just unsubscribing, default to false
|
1213 |
-
* @param boolean $send_goodbye flag to send the goodbye email to the email addresses, defaults to true
|
1214 |
-
* @param boolean $send_notify flag to send the unsubscribe notification email to the address defined in the list email notification settings, defaults to false
|
1215 |
-
* @return struct Array of result counts and any errors that occurred
|
1216 |
-
* @returnf integer success_count Number of email addresses that were succesfully added/updated
|
1217 |
-
* @returnf integer error_count Number of email addresses that failed during addition/updating
|
1218 |
-
* @returnf array errors Array of error structs. Each error struct will contain "code", "message", and "email"
|
1219 |
-
*/
|
1220 |
-
function listBatchUnsubscribe($id, $emails, $delete_member=false, $send_goodbye=true, $send_notify=false) {
|
1221 |
-
$params = array();
|
1222 |
-
$params["id"] = $id;
|
1223 |
-
$params["emails"] = $emails;
|
1224 |
-
$params["delete_member"] = $delete_member;
|
1225 |
-
$params["send_goodbye"] = $send_goodbye;
|
1226 |
-
$params["send_notify"] = $send_notify;
|
1227 |
-
return $this->callServer("listBatchUnsubscribe", $params);
|
1228 |
-
}
|
1229 |
-
|
1230 |
-
/**
|
1231 |
-
* Get all of the list members for a list that are of a particular status
|
1232 |
-
*
|
1233 |
-
* @section List Related
|
1234 |
-
* @example mcapi_listMembers.php
|
1235 |
-
*
|
1236 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1237 |
-
* @param string $status the status to get members for - one of(subscribed, unsubscribed, cleaned, updated), defaults to subscribed
|
1238 |
-
* @param string $since optional pull all members whose status (subscribed/unsubscribed/cleaned) has changed or whose profile (updated) has changed since this date/time (in GMT) - format is YYYY-MM-DD HH:mm:ss (24hr)
|
1239 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
1240 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 100, upper limit set at 15000
|
1241 |
-
* @return array Array of list member structs (see Returned Fields for details)
|
1242 |
-
* @returnf string email Member email address
|
1243 |
-
* @returnf date timestamp timestamp of their associated status date (subscribed, unsubscribed, cleaned, or updated) in GMT
|
1244 |
-
*/
|
1245 |
-
function listMembers($id, $status='subscribed', $since=NULL, $start=0, $limit=100) {
|
1246 |
-
$params = array();
|
1247 |
-
$params["id"] = $id;
|
1248 |
-
$params["status"] = $status;
|
1249 |
-
$params["since"] = $since;
|
1250 |
-
$params["start"] = $start;
|
1251 |
-
$params["limit"] = $limit;
|
1252 |
-
return $this->callServer("listMembers", $params);
|
1253 |
-
}
|
1254 |
-
|
1255 |
-
/**
|
1256 |
-
* Get all the information for a particular member of a list
|
1257 |
-
*
|
1258 |
-
* @section List Related
|
1259 |
-
* @example mcapi_listMemberInfo.php
|
1260 |
-
* @example xml-rpc_listMemberInfo.php
|
1261 |
-
*
|
1262 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1263 |
-
* @param string $email_address the member email address to get information for
|
1264 |
-
* @return array array of list member info (see Returned Fields for details)
|
1265 |
-
* @returnf string email The email address associated with this record
|
1266 |
-
* @returnf string email_type The type of emails this customer asked to get: html or text
|
1267 |
-
* @returnf array merges An associative array of all the merge tags and the data for those tags for this email address. <em>Note</em>: Interest Groups are returned as comma delimited strings - if a group name contains a comma, it will be escaped with a backslash. ie, "," => "\,"
|
1268 |
-
* @returnf string status The subscription status for this email address, either subscribed, unsubscribed or cleaned
|
1269 |
-
* @returnf string ip_opt IP Address this address opted in from.
|
1270 |
-
* @returnf string ip_signup IP Address this address signed up from.
|
1271 |
-
* @returnf array lists An associative array of the other lists this member belongs to - the key is the list id and the value is their status in that list.
|
1272 |
-
* @returnf date timestamp The time this email address was added to the list
|
1273 |
-
*/
|
1274 |
-
function listMemberInfo($id, $email_address) {
|
1275 |
-
$params = array();
|
1276 |
-
$params["id"] = $id;
|
1277 |
-
$params["email_address"] = $email_address;
|
1278 |
-
return $this->callServer("listMemberInfo", $params);
|
1279 |
-
}
|
1280 |
-
|
1281 |
-
/**
|
1282 |
-
* Get all email addresses that complained about a given campaign
|
1283 |
-
*
|
1284 |
-
* @section List Related
|
1285 |
-
*
|
1286 |
-
* @example mcapi_listAbuseReports.php
|
1287 |
-
*
|
1288 |
-
* @param string $id the list id to pull abuse reports for (can be gathered using lists())
|
1289 |
-
* @param integer $start optional for large data sets, the page number to start at - defaults to 1st page of data (page 0)
|
1290 |
-
* @param integer $limit optional for large data sets, the number of results to return - defaults to 500, upper limit set at 1000
|
1291 |
-
* @param string $since optional pull only messages since this time - use YYYY-MM-DD HH:II:SS format in <strong>GMT</strong>
|
1292 |
-
* @return array reports the abuse reports for this campaign
|
1293 |
-
* @returnf string date date/time the abuse report was received and processed
|
1294 |
-
* @returnf string email the email address that reported abuse
|
1295 |
-
* @returnf string campaign_id the unique id for the campaign that reporte was made against
|
1296 |
-
* @returnf string type an internal type generally specifying the orginating mail provider - may not be useful outside of filling report views
|
1297 |
-
*/
|
1298 |
-
function listAbuseReports($id, $start=0, $limit=500, $since=NULL) {
|
1299 |
-
$params = array();
|
1300 |
-
$params["id"] = $id;
|
1301 |
-
$params["start"] = $start;
|
1302 |
-
$params["limit"] = $limit;
|
1303 |
-
$params["since"] = $since;
|
1304 |
-
return $this->callServer("listAbuseReports", $params);
|
1305 |
-
}
|
1306 |
-
|
1307 |
-
/**
|
1308 |
-
* Access the Growth History by Month for a given list.
|
1309 |
-
*
|
1310 |
-
* @section List Related
|
1311 |
-
*
|
1312 |
-
* @example mcapi_listGrowthHistory.php
|
1313 |
-
*
|
1314 |
-
* @param string $id the list id to connect to. Get by calling lists()
|
1315 |
-
* @return array array of months and growth
|
1316 |
-
* @returnf string month The Year and Month in question using YYYY-MM format
|
1317 |
-
* @returnf integer existing number of existing subscribers to start the month
|
1318 |
-
* @returnf integer import number of subscribers imported during the month
|
1319 |
-
* @returnf integer optins number of subscribers who opted-in during the month
|
1320 |
-
*/
|
1321 |
-
function listGrowthHistory($id) {
|
1322 |
-
$params = array();
|
1323 |
-
$params["id"] = $id;
|
1324 |
-
return $this->callServer("listGrowthHistory", $params);
|
1325 |
-
}
|
1326 |
-
|
1327 |
-
/**
|
1328 |
-
* <strong>DEPRECATED:</strong> Retrieve your User Unique Id and your Affiliate link to display/use for
|
1329 |
-
* <a href="/monkeyrewards/" target="_blank">Monkey Rewards</a>. While
|
1330 |
-
* we don't use the User Id for any API functions, it can be useful if building up URL strings for things such as the profile editor and sub/unsub links.
|
1331 |
-
*
|
1332 |
-
* @section Helper
|
1333 |
-
*
|
1334 |
-
* @deprecated See getAccountDetails() for replacement
|
1335 |
-
*
|
1336 |
-
* @example mcapi_getAffiliateInfo.php
|
1337 |
-
* @example xml-rpc_getAffiliateInfo.php
|
1338 |
-
*
|
1339 |
-
* @return array containing your Affilliate Id and full link.
|
1340 |
-
* @returnf string user_id Your User Unique Id.
|
1341 |
-
* @returnf string url Your Monkey Rewards link for our Affiliate program
|
1342 |
-
*/
|
1343 |
-
function getAffiliateInfo() {
|
1344 |
-
$params = array();
|
1345 |
-
return $this->callServer("getAffiliateInfo", $params);
|
1346 |
-
}
|
1347 |
-
|
1348 |
-
/**
|
1349 |
-
* Retrieve lots of account information including payments made, plan info, some account stats, installed modules,
|
1350 |
-
* contact info, and more. No private information like Credit Card numbers is available.
|
1351 |
-
*
|
1352 |
-
* @section Helper
|
1353 |
-
*
|
1354 |
-
* @return array containing the details for the account tied to this API Key
|
1355 |
-
* @returnf string username The Account username
|
1356 |
-
* @returnf string user_id The Account user unique id (for building some links)
|
1357 |
-
* @returnf bool is_trial Whether the Account is in Trial mode (can only send campaigns to less than 100 emails)
|
1358 |
-
* @returnf string timezone The timezone for the Account - default is "US/Eastern"
|
1359 |
-
* @returnf string plan_type Plan Type - "monthly", "payasyougo", or "free"
|
1360 |
-
* @returnf int plan_low <em>only for Monthly plans</em> - the lower tier for list size
|
1361 |
-
* @returnf int plan_high <em>only for Monthly plans</em> - the upper tier for list size
|
1362 |
-
* @returnf datetime plan_start_date <em>only for Monthly plans</em> - the start date for a monthly plan
|
1363 |
-
* @returnf int emails_left <em>only for Free and Pay-as-you-go plans</em> emails credits left for the account
|
1364 |
-
* @returnf bool pending_monthly Whether the account is finishing Pay As You Go credits before switching to a Monthly plan
|
1365 |
-
* @returnf datetime first_payment date of first payment
|
1366 |
-
* @returnf datetime last_payment date of most recent payment
|
1367 |
-
* @returnf int times_logged_in total number of times the account has been logged into via the web
|
1368 |
-
* @returnf datetime last_login date/time of last login via the web
|
1369 |
-
* @returnf string affiliate_link Monkey Rewards link for our Affiliate program
|
1370 |
-
* @returnf array contact Contact details for the account, including: First & Last name, email, company name, address, phone, and url
|
1371 |
-
* @returnf array addons Addons installed in the account and the date they were installed.
|
1372 |
-
* @returnf array orders Order details for the account, include order_id, type, cost, date/time, and any credits applied to the order
|
1373 |
-
*/
|
1374 |
-
function getAccountDetails() {
|
1375 |
-
$params = array();
|
1376 |
-
return $this->callServer("getAccountDetails", $params);
|
1377 |
-
}
|
1378 |
-
|
1379 |
-
/**
|
1380 |
-
* Have HTML content auto-converted to a text-only format. You can send: plain HTML, an array of Template content, an existing Campaign Id, or an existing Template Id. Note that this will <b>not</b> save anything to or update any of your lists, campaigns, or templates.
|
1381 |
-
*
|
1382 |
-
* @section Helper
|
1383 |
-
* @example xml-rpc_generateText.php
|
1384 |
-
*
|
1385 |
-
* @param string $type The type of content to parse. Must be one of: "html", "template", "url", "cid" (Campaign Id), or "tid" (Template Id)
|
1386 |
-
* @param mixed $content The content to use. For "html" expects a single string value, "template" expects an array like you send to campaignCreate, "url" expects a valid & public URL to pull from, "cid" expects a valid Campaign Id, and "tid" expects a valid Template Id on your account.
|
1387 |
-
* @return string the content pass in converted to text.
|
1388 |
-
*/
|
1389 |
-
function generateText($type, $content) {
|
1390 |
-
$params = array();
|
1391 |
-
$params["type"] = $type;
|
1392 |
-
$params["content"] = $content;
|
1393 |
-
return $this->callServer("generateText", $params);
|
1394 |
-
}
|
1395 |
-
|
1396 |
-
/**
|
1397 |
-
* Send your HTML content to have the CSS inlined and optionally remove the original styles.
|
1398 |
-
*
|
1399 |
-
* @section Helper
|
1400 |
-
* @example xml-rpc_inlineCss.php
|
1401 |
-
*
|
1402 |
-
* @param string $html Your HTML content
|
1403 |
-
* @param bool $strip_css optional Whether you want the CSS <style> tags stripped from the returned document. Defaults to false.
|
1404 |
-
* @return string Your HTML content with all CSS inlined, just like if we sent it.
|
1405 |
-
*/
|
1406 |
-
function inlineCss($html, $strip_css=false) {
|
1407 |
-
$params = array();
|
1408 |
-
$params["html"] = $html;
|
1409 |
-
$params["strip_css"] = $strip_css;
|
1410 |
-
return $this->callServer("inlineCss", $params);
|
1411 |
-
}
|
1412 |
-
|
1413 |
-
/**
|
1414 |
-
* Create a new folder to file campaigns in
|
1415 |
-
*
|
1416 |
-
* @section Helper
|
1417 |
-
* @example mcapi_createFolder.php
|
1418 |
-
* @example xml-rpc_createFolder.php
|
1419 |
-
*
|
1420 |
-
* @param string $name a unique name for a folder
|
1421 |
-
* @return integer the folder_id of the newly created folder.
|
1422 |
-
*/
|
1423 |
-
function createFolder($name) {
|
1424 |
-
$params = array();
|
1425 |
-
$params["name"] = $name;
|
1426 |
-
return $this->callServer("createFolder", $params);
|
1427 |
-
}
|
1428 |
-
|
1429 |
-
/**
|
1430 |
-
* Retrieve a list of all MailChimp API Keys for this User
|
1431 |
-
*
|
1432 |
-
* @section Security Related
|
1433 |
-
* @example xml-rpc_apikeyAdd.php
|
1434 |
-
* @example mcapi_apikeyAdd.php
|
1435 |
-
*
|
1436 |
-
* @param string $username Your MailChimp user name
|
1437 |
-
* @param string $password Your MailChimp password
|
1438 |
-
* @param boolean $expired optional - whether or not to include expired keys, defaults to false
|
1439 |
-
* @return array an array of API keys including:
|
1440 |
-
* @returnf string apikey The api key that can be used
|
1441 |
-
* @returnf string created_at The date the key was created
|
1442 |
-
* @returnf string expired_at The date the key was expired
|
1443 |
-
*/
|
1444 |
-
function apikeys($username, $password, $expired=false) {
|
1445 |
-
$params = array();
|
1446 |
-
$params["username"] = $username;
|
1447 |
-
$params["password"] = $password;
|
1448 |
-
$params["expired"] = $expired;
|
1449 |
-
return $this->callServer("apikeys", $params);
|
1450 |
-
}
|
1451 |
-
|
1452 |
-
/**
|
1453 |
-
* Add an API Key to your account. We will generate a new key for you and return it.
|
1454 |
-
*
|
1455 |
-
* @section Security Related
|
1456 |
-
* @example xml-rpc_apikeyAdd.php
|
1457 |
-
*
|
1458 |
-
* @param string $username Your MailChimp user name
|
1459 |
-
* @param string $password Your MailChimp password
|
1460 |
-
* @return string a new API Key that can be immediately used.
|
1461 |
-
*/
|
1462 |
-
function apikeyAdd($username, $password) {
|
1463 |
-
$params = array();
|
1464 |
-
$params["username"] = $username;
|
1465 |
-
$params["password"] = $password;
|
1466 |
-
return $this->callServer("apikeyAdd", $params);
|
1467 |
-
}
|
1468 |
-
|
1469 |
-
/**
|
1470 |
-
* Expire a Specific API Key. Note that if you expire all of your keys, a new, valid one will be created and returned
|
1471 |
-
* next time you call login(). If you are trying to shut off access to your account for an old developer, change your
|
1472 |
-
* MailChimp password, then expire all of the keys they had access to. Note that this takes effect immediately, so make
|
1473 |
-
* sure you replace the keys in any working application before expiring them! Consider yourself warned...
|
1474 |
-
*
|
1475 |
-
* @section Security Related
|
1476 |
-
* @example mcapi_apikeyExpire.php
|
1477 |
-
* @example xml-rpc_apikeyExpire.php
|
1478 |
-
*
|
1479 |
-
* @param string $username Your MailChimp user name
|
1480 |
-
* @param string $password Your MailChimp password
|
1481 |
-
* @return boolean true if it worked, otherwise an error is thrown.
|
1482 |
-
*/
|
1483 |
-
function apikeyExpire($username, $password) {
|
1484 |
-
$params = array();
|
1485 |
-
$params["username"] = $username;
|
1486 |
-
$params["password"] = $password;
|
1487 |
-
return $this->callServer("apikeyExpire", $params);
|
1488 |
-
}
|
1489 |
-
|
1490 |
-
/**
|
1491 |
-
* "Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note
|
1492 |
-
* than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply receive a different
|
1493 |
-
* string back that will explain our view on what is going on.
|
1494 |
-
*
|
1495 |
-
* @section Helper
|
1496 |
-
* @example xml-rpc_ping.php
|
1497 |
-
*
|
1498 |
-
* @return string returns "Everything's Chimpy!" if everything is chimpy, otherwise returns an error message
|
1499 |
-
*/
|
1500 |
-
function ping() {
|
1501 |
-
$params = array();
|
1502 |
-
return $this->callServer("ping", $params);
|
1503 |
-
}
|
1504 |
-
|
1505 |
-
/**
|
1506 |
-
* Internal function - proxy method for certain XML-RPC calls | DO NOT CALL
|
1507 |
-
* @param mixed Method to call, with any parameters to pass along
|
1508 |
-
* @return mixed the result of the call
|
1509 |
-
*/
|
1510 |
-
function callMethod() {
|
1511 |
-
$params = array();
|
1512 |
-
return $this->callServer("callMethod", $params);
|
1513 |
-
}
|
1514 |
-
|
1515 |
-
/**
|
1516 |
-
* Actually connect to the server and call the requested methods, parsing the result
|
1517 |
-
* You should never have to call this function manually
|
1518 |
-
*/
|
1519 |
-
function callServer($method, $params) {
|
1520 |
-
//Always include the apikey if we are not logging in
|
1521 |
-
if($method != "login") {
|
1522 |
-
list($key, $dc) = explode("-",$this->api_key,2);
|
1523 |
-
if (!$dc) $dc = "us1";
|
1524 |
-
$host = $dc.".".$this->apiUrl["host"];
|
1525 |
-
$params["apikey"] = $this->api_key;
|
1526 |
-
} else {
|
1527 |
-
$host = $this->apiUrl["host"];
|
1528 |
-
}
|
1529 |
-
$this->errorMessage = "";
|
1530 |
-
$this->errorCode = "";
|
1531 |
-
$post_vars = $this->httpBuildQuery($params);
|
1532 |
-
|
1533 |
-
$payload = "POST " . $this->apiUrl["path"] . "?" . $this->apiUrl["query"] . "&method=" . $method . " HTTP/1.0\r\n";
|
1534 |
-
$payload .= "Host: " . $host . "\r\n";
|
1535 |
-
$payload .= "User-Agent: MCAPI/" . $this->version ."\r\n";
|
1536 |
-
$payload .= "Content-type: application/x-www-form-urlencoded\r\n";
|
1537 |
-
$payload .= "Content-length: " . strlen($post_vars) . "\r\n";
|
1538 |
-
$payload .= "Connection: close \r\n\r\n";
|
1539 |
-
$payload .= $post_vars;
|
1540 |
-
|
1541 |
-
ob_start();
|
1542 |
-
if ($this->secure){
|
1543 |
-
$sock = fsockopen("ssl://".$host, 443, $errno, $errstr, $this->timeout);
|
1544 |
-
} else {
|
1545 |
-
$sock = fsockopen($host, 80, $errno, $errstr, $this->timeout);
|
1546 |
-
}
|
1547 |
-
if(!$sock) {
|
1548 |
-
$this->errorMessage = "Could not connect (ERR $errno: $errstr)";
|
1549 |
-
$this->errorCode = "-99";
|
1550 |
-
ob_end_clean();
|
1551 |
-
return false;
|
1552 |
-
}
|
1553 |
-
|
1554 |
-
$response = "";
|
1555 |
-
fwrite($sock, $payload);
|
1556 |
-
while(!feof($sock)) {
|
1557 |
-
$response .= fread($sock, $this->chunkSize);
|
1558 |
-
}
|
1559 |
-
fclose($sock);
|
1560 |
-
ob_end_clean();
|
1561 |
-
|
1562 |
-
list($throw, $response) = explode("\r\n\r\n", $response, 2);
|
1563 |
-
|
1564 |
-
if(ini_get("magic_quotes_runtime")) $response = stripslashes($response);
|
1565 |
-
|
1566 |
-
$serial = unserialize($response);
|
1567 |
-
if($response && $serial === false) {
|
1568 |
-
$response = array("error" => "Bad Response. Got This: " . $response, "code" => "-99");
|
1569 |
-
} else {
|
1570 |
-
$response = $serial;
|
1571 |
-
}
|
1572 |
-
if(is_array($response) && isset($response["error"])) {
|
1573 |
-
$this->errorMessage = $response["error"];
|
1574 |
-
$this->errorCode = $response["code"];
|
1575 |
-
return false;
|
1576 |
-
}
|
1577 |
-
|
1578 |
-
return $response;
|
1579 |
-
}
|
1580 |
-
|
1581 |
-
/**
|
1582 |
-
* Re-implement http_build_query for systems that do not already have it
|
1583 |
-
*/
|
1584 |
-
function httpBuildQuery($params, $key=null) {
|
1585 |
-
$ret = array();
|
1586 |
-
|
1587 |
-
foreach((array) $params as $name => $val) {
|
1588 |
-
$name = urlencode($name);
|
1589 |
-
if($key !== null) {
|
1590 |
-
$name = $key . "[" . $name . "]";
|
1591 |
-
}
|
1592 |
-
|
1593 |
-
if(is_array($val) || is_object($val)) {
|
1594 |
-
$ret[] = $this->httpBuildQuery($val, $name);
|
1595 |
-
} elseif($val !== null) {
|
1596 |
-
$ret[] = $name . "=" . urlencode($val);
|
1597 |
-
}
|
1598 |
-
}
|
1599 |
-
|
1600 |
-
return implode("&", $ret);
|
1601 |
-
}
|
1602 |
-
}
|
1603 |
-
|
1604 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mailchimp.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: MailChimp
|
4 |
Plugin URI: http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/
|
5 |
Description: The MailChimp plugin allows you to quickly and easily add a signup form for your MailChimp list.
|
6 |
-
Version: 1.2.
|
7 |
Author: MailChimp and Crowd Favorite
|
8 |
Author URI: http://mailchimp.com/api/
|
9 |
*/
|
@@ -25,7 +25,7 @@ Author URI: http://mailchimp.com/api/
|
|
25 |
*/
|
26 |
|
27 |
// Version constant for easy CSS refreshes
|
28 |
-
define('MCSF_VER', '1.2.
|
29 |
|
30 |
// What's our permission (capability) threshold
|
31 |
define('MCSF_CAP_THRESHOLD', 'edit_plugins');
|
@@ -34,8 +34,8 @@ define('MCSF_CAP_THRESHOLD', 'edit_plugins');
|
|
34 |
mailchimpSF_where_am_i();
|
35 |
|
36 |
// Get our MailChimp API class in scope
|
37 |
-
if (!class_exists('
|
38 |
-
require_once('
|
39 |
}
|
40 |
|
41 |
// includes the widget code so it can be easily called either normally or via ajax
|
@@ -264,27 +264,22 @@ add_action('init', 'mailchimpSF_request_handler');
|
|
264 |
* @return bool
|
265 |
**/
|
266 |
function mailchimpSF_needs_upgrade() {
|
267 |
-
$
|
268 |
-
return !
|
269 |
}
|
270 |
|
271 |
/**
|
272 |
-
*
|
273 |
-
*
|
274 |
*/
|
275 |
function mailchimpSF_do_upgrade() {
|
276 |
-
//
|
277 |
-
$api = new MCAPI(get_option('mc_username'), get_option('mc_password'));
|
278 |
-
if (empty($api->errorCode)) {
|
279 |
-
update_option('mc_apikey', $api->api_key);
|
280 |
-
//this should already be here, but let's make sure anyway
|
281 |
-
$req = $api->getAffiliateInfo();
|
282 |
-
update_option('mc_user_id', $req['user_id']);
|
283 |
-
} else {
|
284 |
-
$msg = "<p class='error_msg'>".esc_html(__( "While upgrading the plugin setup, we were unable to login to your account. You will need to login again and setup your list.", 'mailchimp_i18n' ))."</p>";
|
285 |
-
mailchimpSF_global_msg($msg);
|
286 |
-
}
|
287 |
delete_option('mc_password');
|
|
|
|
|
|
|
|
|
|
|
288 |
}
|
289 |
|
290 |
/**
|
@@ -294,7 +289,7 @@ function mailchimpSF_do_upgrade() {
|
|
294 |
**/
|
295 |
function mailchimpSF_set_api_key($api_key = '') {
|
296 |
$delete_setup = false;
|
297 |
-
$api = new
|
298 |
$api->ping();
|
299 |
if (empty($api->errorCode)) {
|
300 |
$msg = "<p class='success_msg'>".esc_html(__("Success! We were able to verify your API Key! Let's continue, shall we?", 'mailchimp_i18n'))."</p>";
|
@@ -304,7 +299,9 @@ function mailchimpSF_set_api_key($api_key = '') {
|
|
304 |
update_option('mc_user_id', $req['user_id']);
|
305 |
$cur_list_id = get_option('mc_list_id');
|
306 |
if (!empty($cur_list_id)) {
|
307 |
-
|
|
|
|
|
308 |
//but don't delete if the list still exists...
|
309 |
$delete_setup = true;
|
310 |
foreach($lists as $list) {
|
@@ -526,8 +523,10 @@ function mailchimpSF_change_list_if_necessary($api_key) {
|
|
526 |
// Simple permission check before going through all this
|
527 |
if (!current_user_can(MCSF_CAP_THRESHOLD)) { return; }
|
528 |
|
529 |
-
$api = new
|
530 |
-
|
|
|
|
|
531 |
|
532 |
/* If our incoming list ID (the one chosen in the select dropdown)
|
533 |
is in our array of lists, the set it to be the active list */
|
@@ -551,8 +550,8 @@ function mailchimpSF_change_list_if_necessary($api_key) {
|
|
551 |
|
552 |
// Grab the merge vars and interest groups
|
553 |
$mv = $api->listMergeVars($list_id);
|
554 |
-
$ig = $api->
|
555 |
-
|
556 |
update_option('mc_merge_vars', $mv);
|
557 |
foreach($mv as $var){
|
558 |
$opt = 'mc_mv_'.$var['tag'];
|
@@ -567,7 +566,7 @@ function mailchimpSF_change_list_if_necessary($api_key) {
|
|
567 |
sprintf(
|
568 |
__('Success! Loaded and saved the info for %d Merge Variables and %d Interest Groups from your list', 'mailchimp_i18n'),
|
569 |
count($mv),
|
570 |
-
count($ig)
|
571 |
).
|
572 |
' "'.$list_name.'"<br/><br/>'.
|
573 |
__('Now you should either Turn On the MailChimp Widget or change your options below, then turn it on.', 'mailchimp_i18n').'</p>';
|
@@ -697,10 +696,11 @@ if (get_option('mc_apikey')!=''){
|
|
697 |
|
698 |
<form method="post" action="options-general.php?page=mailchimpSF_options">
|
699 |
<?php
|
700 |
-
|
701 |
-
|
702 |
-
$lists =
|
703 |
-
|
|
|
704 |
if (count($lists) == 0) {
|
705 |
?>
|
706 |
<span class='error_msg'>
|
@@ -955,7 +955,7 @@ else {
|
|
955 |
<?php
|
956 |
foreach($ig['groups'] as $interest){
|
957 |
?>
|
958 |
-
<li><?php echo esc_html($interest); ?></li>
|
959 |
<?php
|
960 |
}
|
961 |
?>
|
@@ -1058,9 +1058,8 @@ function mailchimpSF_signup_submit() {
|
|
1058 |
if (count($merge) == 0 || $merge == '') {
|
1059 |
$merge = '';
|
1060 |
}
|
1061 |
-
|
1062 |
-
$
|
1063 |
-
$api = new MCAPI('no_login','is_needed');
|
1064 |
$retval = $api->listSubscribe( $listId, $email, $merge);
|
1065 |
if (!$retval) {
|
1066 |
switch($api->errorCode) {
|
3 |
Plugin Name: MailChimp
|
4 |
Plugin URI: http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/
|
5 |
Description: The MailChimp plugin allows you to quickly and easily add a signup form for your MailChimp list.
|
6 |
+
Version: 1.2.2
|
7 |
Author: MailChimp and Crowd Favorite
|
8 |
Author URI: http://mailchimp.com/api/
|
9 |
*/
|
25 |
*/
|
26 |
|
27 |
// Version constant for easy CSS refreshes
|
28 |
+
define('MCSF_VER', '1.2.2');
|
29 |
|
30 |
// What's our permission (capability) threshold
|
31 |
define('MCSF_CAP_THRESHOLD', 'edit_plugins');
|
34 |
mailchimpSF_where_am_i();
|
35 |
|
36 |
// Get our MailChimp API class in scope
|
37 |
+
if (!class_exists('mailchimpSF_MCAPI')) {
|
38 |
+
require_once('miniMCAPI.class.php');
|
39 |
}
|
40 |
|
41 |
// includes the widget code so it can be easily called either normally or via ajax
|
264 |
* @return bool
|
265 |
**/
|
266 |
function mailchimpSF_needs_upgrade() {
|
267 |
+
$ig = get_option('mc_interest_groups');
|
268 |
+
return get_option('mc_show_interest_groups') == 'on' && (!is_array($ig['groups']) || !is_array($ig['groups'][0]));
|
269 |
}
|
270 |
|
271 |
/**
|
272 |
+
* MCAPIv1.2 -> MCAPIv1.3 - update interest groups
|
273 |
+
* 2011-02-09 - old password upgrade code deleted as 0.5 is way old
|
274 |
*/
|
275 |
function mailchimpSF_do_upgrade() {
|
276 |
+
//left in just for good measure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
277 |
delete_option('mc_password');
|
278 |
+
$api = new mailchimpSF_MCAPI(get_option('mc_apikey'));
|
279 |
+
$ig = $api->listInterestGroupings(get_option('mc_list_id'));
|
280 |
+
$ig = $ig[0];
|
281 |
+
update_option('mc_interest_groups', $ig);
|
282 |
+
|
283 |
}
|
284 |
|
285 |
/**
|
289 |
**/
|
290 |
function mailchimpSF_set_api_key($api_key = '') {
|
291 |
$delete_setup = false;
|
292 |
+
$api = new mailchimpSF_MCAPI($api_key);
|
293 |
$api->ping();
|
294 |
if (empty($api->errorCode)) {
|
295 |
$msg = "<p class='success_msg'>".esc_html(__("Success! We were able to verify your API Key! Let's continue, shall we?", 'mailchimp_i18n'))."</p>";
|
299 |
update_option('mc_user_id', $req['user_id']);
|
300 |
$cur_list_id = get_option('mc_list_id');
|
301 |
if (!empty($cur_list_id)) {
|
302 |
+
//we *could* support paging, but few users have that many lists (and shouldn't)
|
303 |
+
$lists = $api->lists(array(),0,100);
|
304 |
+
$lists = $lists['data'];
|
305 |
//but don't delete if the list still exists...
|
306 |
$delete_setup = true;
|
307 |
foreach($lists as $list) {
|
523 |
// Simple permission check before going through all this
|
524 |
if (!current_user_can(MCSF_CAP_THRESHOLD)) { return; }
|
525 |
|
526 |
+
$api = new mailchimpSF_MCAPI($api_key);
|
527 |
+
//we *could* support paging, but few users have that many lists (and shouldn't)
|
528 |
+
$lists = $api->lists(array(),0,100);
|
529 |
+
$lists = $lists['data'];
|
530 |
|
531 |
/* If our incoming list ID (the one chosen in the select dropdown)
|
532 |
is in our array of lists, the set it to be the active list */
|
550 |
|
551 |
// Grab the merge vars and interest groups
|
552 |
$mv = $api->listMergeVars($list_id);
|
553 |
+
$ig = $api->listInterestGroupings($list_id);
|
554 |
+
$ig = $ig[0];
|
555 |
update_option('mc_merge_vars', $mv);
|
556 |
foreach($mv as $var){
|
557 |
$opt = 'mc_mv_'.$var['tag'];
|
566 |
sprintf(
|
567 |
__('Success! Loaded and saved the info for %d Merge Variables and %d Interest Groups from your list', 'mailchimp_i18n'),
|
568 |
count($mv),
|
569 |
+
count($ig['groups'])
|
570 |
).
|
571 |
' "'.$list_name.'"<br/><br/>'.
|
572 |
__('Now you should either Turn On the MailChimp Widget or change your options below, then turn it on.', 'mailchimp_i18n').'</p>';
|
696 |
|
697 |
<form method="post" action="options-general.php?page=mailchimpSF_options">
|
698 |
<?php
|
699 |
+
$api = new mailchimpSF_MCAPI(get_option('mc_apikey'));
|
700 |
+
//we *could* support paging, but few users have that many lists (and shouldn't)
|
701 |
+
$lists = $api->lists(array(),0,100);
|
702 |
+
$lists = $lists['data'];
|
703 |
+
|
704 |
if (count($lists) == 0) {
|
705 |
?>
|
706 |
<span class='error_msg'>
|
955 |
<?php
|
956 |
foreach($ig['groups'] as $interest){
|
957 |
?>
|
958 |
+
<li><?php echo esc_html($interest['name']); ?></li>
|
959 |
<?php
|
960 |
}
|
961 |
?>
|
1058 |
if (count($merge) == 0 || $merge == '') {
|
1059 |
$merge = '';
|
1060 |
}
|
1061 |
+
|
1062 |
+
$api = new mailchimpSF_MCAPI(get_option('mc_apikey'));
|
|
|
1063 |
$retval = $api->listSubscribe( $listId, $email, $merge);
|
1064 |
if (!$retval) {
|
1065 |
switch($api->errorCode) {
|
mailchimp_widget.php
CHANGED
@@ -132,6 +132,7 @@ function mailchimpSF_signup_form($args = array()) {
|
|
132 |
case 'checkbox':
|
133 |
case 'checkboxes':
|
134 |
foreach($ig['groups'] as $interest){
|
|
|
135 |
?>
|
136 |
<input type="checkbox" name="<?php echo esc_attr('interests['.$interest.']'); ?>" id="<?php echo esc_attr('mc_interest_'.$i); ?>" class="mc_interest"/>
|
137 |
<label for="<?php echo esc_attr('mc_interest_'.$i); ?>" class="mc_interest_label"> <?php echo esc_html($interest); ?></label>
|
@@ -142,6 +143,7 @@ function mailchimpSF_signup_form($args = array()) {
|
|
142 |
break;
|
143 |
case 'radio':
|
144 |
foreach($ig['groups'] as $interest){
|
|
|
145 |
?>
|
146 |
<input type="radio" name="interests" id="<?php echo esc_attr('mc_interest_'.$i); ?>" class="mc_interest" value="<?php echo esc_attr($interest); ?>"/>
|
147 |
<label for="<?php echo esc_attr('mc_interest_'.$i); ?>" class="mc_interest_label"> <?php echo esc_html($interest); ?></label>
|
@@ -157,6 +159,7 @@ function mailchimpSF_signup_form($args = array()) {
|
|
157 |
<option value=""></option>
|
158 |
<?php
|
159 |
foreach($ig['groups'] as $interest){
|
|
|
160 |
?>
|
161 |
<option value="<?php echo esc_attr($interest); ?>"><?php echo esc_html($interest); ?></option>
|
162 |
<?php
|
132 |
case 'checkbox':
|
133 |
case 'checkboxes':
|
134 |
foreach($ig['groups'] as $interest){
|
135 |
+
$interest = $interest['name'];
|
136 |
?>
|
137 |
<input type="checkbox" name="<?php echo esc_attr('interests['.$interest.']'); ?>" id="<?php echo esc_attr('mc_interest_'.$i); ?>" class="mc_interest"/>
|
138 |
<label for="<?php echo esc_attr('mc_interest_'.$i); ?>" class="mc_interest_label"> <?php echo esc_html($interest); ?></label>
|
143 |
break;
|
144 |
case 'radio':
|
145 |
foreach($ig['groups'] as $interest){
|
146 |
+
$interest = $interest['name'];
|
147 |
?>
|
148 |
<input type="radio" name="interests" id="<?php echo esc_attr('mc_interest_'.$i); ?>" class="mc_interest" value="<?php echo esc_attr($interest); ?>"/>
|
149 |
<label for="<?php echo esc_attr('mc_interest_'.$i); ?>" class="mc_interest_label"> <?php echo esc_html($interest); ?></label>
|
159 |
<option value=""></option>
|
160 |
<?php
|
161 |
foreach($ig['groups'] as $interest){
|
162 |
+
$interest = $interest['name'];
|
163 |
?>
|
164 |
<option value="<?php echo esc_attr($interest); ?>"><?php echo esc_html($interest); ?></option>
|
165 |
<?php
|
miniMCAPI.class.php
ADDED
@@ -0,0 +1,403 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
This is a subset of the Actual MCAPI and miniMCAPI classes for v1.3 that includes the list related methods and support for PHP4
|
4 |
+
DOWNLOAD A NEW VERSION IF YOU WANT THE FULL, CORRECT WRAPPER.
|
5 |
+
**/
|
6 |
+
class mailchimpSF_MCAPI {
|
7 |
+
var $version = "1.3";
|
8 |
+
var $errorMessage;
|
9 |
+
var $errorCode;
|
10 |
+
|
11 |
+
/**
|
12 |
+
* Cache the information on the API location on the server
|
13 |
+
*/
|
14 |
+
var $apiUrl;
|
15 |
+
|
16 |
+
/**
|
17 |
+
* Default to a 300 second timeout on server calls
|
18 |
+
*/
|
19 |
+
var $timeout = 300;
|
20 |
+
|
21 |
+
/**
|
22 |
+
* Default to a 8K chunk size
|
23 |
+
*/
|
24 |
+
var $chunkSize = 8192;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Cache the user api_key so we only have to log in once per client instantiation
|
28 |
+
*/
|
29 |
+
var $api_key;
|
30 |
+
|
31 |
+
/**
|
32 |
+
* Cache the user api_key so we only have to log in once per client instantiation
|
33 |
+
*/
|
34 |
+
var $secure = false;
|
35 |
+
|
36 |
+
/**
|
37 |
+
* Connect to the MailChimp API for a given list.
|
38 |
+
*
|
39 |
+
* @param string $apikey Your MailChimp apikey
|
40 |
+
* @param string $secure Whether or not this should use a secure connection
|
41 |
+
*/
|
42 |
+
function mailchimpSF_MCAPI($apikey, $secure=false) {
|
43 |
+
$this->secure = $secure;
|
44 |
+
$this->apiUrl = parse_url("http://api.mailchimp.com/" . $this->version . "/?output=php");
|
45 |
+
$this->api_key = $apikey;
|
46 |
+
}
|
47 |
+
function setTimeout($seconds){
|
48 |
+
if (is_int($seconds)){
|
49 |
+
$this->timeout = $seconds;
|
50 |
+
return true;
|
51 |
+
}
|
52 |
+
}
|
53 |
+
function getTimeout(){
|
54 |
+
return $this->timeout;
|
55 |
+
}
|
56 |
+
function useSecure($val){
|
57 |
+
if ($val===true){
|
58 |
+
$this->secure = true;
|
59 |
+
} else {
|
60 |
+
$this->secure = false;
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
function lists($filters=array (
|
65 |
+
), $start=0, $limit=25) {
|
66 |
+
$params = array();
|
67 |
+
$params["filters"] = $filters;
|
68 |
+
$params["start"] = $start;
|
69 |
+
$params["limit"] = $limit;
|
70 |
+
return $this->callServer("lists", $params);
|
71 |
+
}
|
72 |
+
|
73 |
+
function listMergeVars($id) {
|
74 |
+
$params = array();
|
75 |
+
$params["id"] = $id;
|
76 |
+
return $this->callServer("listMergeVars", $params);
|
77 |
+
}
|
78 |
+
|
79 |
+
|
80 |
+
function listMergeVarAdd($id, $tag, $name, $options=array (
|
81 |
+
)) {
|
82 |
+
$params = array();
|
83 |
+
$params["id"] = $id;
|
84 |
+
$params["tag"] = $tag;
|
85 |
+
$params["name"] = $name;
|
86 |
+
$params["options"] = $options;
|
87 |
+
return $this->callServer("listMergeVarAdd", $params);
|
88 |
+
}
|
89 |
+
|
90 |
+
function listMergeVarUpdate($id, $tag, $options) {
|
91 |
+
$params = array();
|
92 |
+
$params["id"] = $id;
|
93 |
+
$params["tag"] = $tag;
|
94 |
+
$params["options"] = $options;
|
95 |
+
return $this->callServer("listMergeVarUpdate", $params);
|
96 |
+
}
|
97 |
+
|
98 |
+
function listMergeVarDel($id, $tag) {
|
99 |
+
$params = array();
|
100 |
+
$params["id"] = $id;
|
101 |
+
$params["tag"] = $tag;
|
102 |
+
return $this->callServer("listMergeVarDel", $params);
|
103 |
+
}
|
104 |
+
|
105 |
+
|
106 |
+
function listInterestGroupings($id) {
|
107 |
+
$params = array();
|
108 |
+
$params["id"] = $id;
|
109 |
+
return $this->callServer("listInterestGroupings", $params);
|
110 |
+
}
|
111 |
+
|
112 |
+
function listInterestGroupAdd($id, $group_name, $grouping_id=NULL) {
|
113 |
+
$params = array();
|
114 |
+
$params["id"] = $id;
|
115 |
+
$params["group_name"] = $group_name;
|
116 |
+
$params["grouping_id"] = $grouping_id;
|
117 |
+
return $this->callServer("listInterestGroupAdd", $params);
|
118 |
+
}
|
119 |
+
|
120 |
+
function listInterestGroupDel($id, $group_name, $grouping_id=NULL) {
|
121 |
+
$params = array();
|
122 |
+
$params["id"] = $id;
|
123 |
+
$params["group_name"] = $group_name;
|
124 |
+
$params["grouping_id"] = $grouping_id;
|
125 |
+
return $this->callServer("listInterestGroupDel", $params);
|
126 |
+
}
|
127 |
+
|
128 |
+
function listInterestGroupUpdate($id, $old_name, $new_name, $grouping_id=NULL) {
|
129 |
+
$params = array();
|
130 |
+
$params["id"] = $id;
|
131 |
+
$params["old_name"] = $old_name;
|
132 |
+
$params["new_name"] = $new_name;
|
133 |
+
$params["grouping_id"] = $grouping_id;
|
134 |
+
return $this->callServer("listInterestGroupUpdate", $params);
|
135 |
+
}
|
136 |
+
|
137 |
+
function listInterestGroupingAdd($id, $name, $type, $groups) {
|
138 |
+
$params = array();
|
139 |
+
$params["id"] = $id;
|
140 |
+
$params["name"] = $name;
|
141 |
+
$params["type"] = $type;
|
142 |
+
$params["groups"] = $groups;
|
143 |
+
return $this->callServer("listInterestGroupingAdd", $params);
|
144 |
+
}
|
145 |
+
|
146 |
+
function listInterestGroupingUpdate($grouping_id, $name, $value) {
|
147 |
+
$params = array();
|
148 |
+
$params["grouping_id"] = $grouping_id;
|
149 |
+
$params["name"] = $name;
|
150 |
+
$params["value"] = $value;
|
151 |
+
return $this->callServer("listInterestGroupingUpdate", $params);
|
152 |
+
}
|
153 |
+
|
154 |
+
|
155 |
+
function listInterestGroupingDel($grouping_id) {
|
156 |
+
$params = array();
|
157 |
+
$params["grouping_id"] = $grouping_id;
|
158 |
+
return $this->callServer("listInterestGroupingDel", $params);
|
159 |
+
}
|
160 |
+
|
161 |
+
function listSubscribe($id, $email_address, $merge_vars=NULL, $email_type='html', $double_optin=true, $update_existing=false, $replace_interests=true, $send_welcome=false) {
|
162 |
+
$params = array();
|
163 |
+
$params["id"] = $id;
|
164 |
+
$params["email_address"] = $email_address;
|
165 |
+
$params["merge_vars"] = $merge_vars;
|
166 |
+
$params["email_type"] = $email_type;
|
167 |
+
$params["double_optin"] = $double_optin;
|
168 |
+
$params["update_existing"] = $update_existing;
|
169 |
+
$params["replace_interests"] = $replace_interests;
|
170 |
+
$params["send_welcome"] = $send_welcome;
|
171 |
+
return $this->callServer("listSubscribe", $params);
|
172 |
+
}
|
173 |
+
|
174 |
+
function listUnsubscribe($id, $email_address, $delete_member=false, $send_goodbye=true, $send_notify=true) {
|
175 |
+
$params = array();
|
176 |
+
$params["id"] = $id;
|
177 |
+
$params["email_address"] = $email_address;
|
178 |
+
$params["delete_member"] = $delete_member;
|
179 |
+
$params["send_goodbye"] = $send_goodbye;
|
180 |
+
$params["send_notify"] = $send_notify;
|
181 |
+
return $this->callServer("listUnsubscribe", $params);
|
182 |
+
}
|
183 |
+
|
184 |
+
|
185 |
+
function listUpdateMember($id, $email_address, $merge_vars, $email_type='', $replace_interests=true) {
|
186 |
+
$params = array();
|
187 |
+
$params["id"] = $id;
|
188 |
+
$params["email_address"] = $email_address;
|
189 |
+
$params["merge_vars"] = $merge_vars;
|
190 |
+
$params["email_type"] = $email_type;
|
191 |
+
$params["replace_interests"] = $replace_interests;
|
192 |
+
return $this->callServer("listUpdateMember", $params);
|
193 |
+
}
|
194 |
+
|
195 |
+
function listBatchSubscribe($id, $batch, $double_optin=true, $update_existing=false, $replace_interests=true) {
|
196 |
+
$params = array();
|
197 |
+
$params["id"] = $id;
|
198 |
+
$params["batch"] = $batch;
|
199 |
+
$params["double_optin"] = $double_optin;
|
200 |
+
$params["update_existing"] = $update_existing;
|
201 |
+
$params["replace_interests"] = $replace_interests;
|
202 |
+
return $this->callServer("listBatchSubscribe", $params);
|
203 |
+
}
|
204 |
+
|
205 |
+
function listBatchUnsubscribe($id, $emails, $delete_member=false, $send_goodbye=true, $send_notify=false) {
|
206 |
+
$params = array();
|
207 |
+
$params["id"] = $id;
|
208 |
+
$params["emails"] = $emails;
|
209 |
+
$params["delete_member"] = $delete_member;
|
210 |
+
$params["send_goodbye"] = $send_goodbye;
|
211 |
+
$params["send_notify"] = $send_notify;
|
212 |
+
return $this->callServer("listBatchUnsubscribe", $params);
|
213 |
+
}
|
214 |
+
|
215 |
+
function listMembers($id, $status='subscribed', $since=NULL, $start=0, $limit=100) {
|
216 |
+
$params = array();
|
217 |
+
$params["id"] = $id;
|
218 |
+
$params["status"] = $status;
|
219 |
+
$params["since"] = $since;
|
220 |
+
$params["start"] = $start;
|
221 |
+
$params["limit"] = $limit;
|
222 |
+
return $this->callServer("listMembers", $params);
|
223 |
+
}
|
224 |
+
|
225 |
+
|
226 |
+
function listMemberInfo($id, $email_address) {
|
227 |
+
$params = array();
|
228 |
+
$params["id"] = $id;
|
229 |
+
$params["email_address"] = $email_address;
|
230 |
+
return $this->callServer("listMemberInfo", $params);
|
231 |
+
}
|
232 |
+
|
233 |
+
function listMemberActivity($id, $email_address) {
|
234 |
+
$params = array();
|
235 |
+
$params["id"] = $id;
|
236 |
+
$params["email_address"] = $email_address;
|
237 |
+
return $this->callServer("listMemberActivity", $params);
|
238 |
+
}
|
239 |
+
|
240 |
+
function getAccountDetails() {
|
241 |
+
$params = array();
|
242 |
+
return $this->callServer("getAccountDetails", $params);
|
243 |
+
}
|
244 |
+
|
245 |
+
function listsForEmail($email_address) {
|
246 |
+
$params = array();
|
247 |
+
$params["email_address"] = $email_address;
|
248 |
+
return $this->callServer("listsForEmail", $params);
|
249 |
+
}
|
250 |
+
|
251 |
+
|
252 |
+
function campaignsForEmail($email_address) {
|
253 |
+
$params = array();
|
254 |
+
$params["email_address"] = $email_address;
|
255 |
+
return $this->callServer("campaignsForEmail", $params);
|
256 |
+
}
|
257 |
+
|
258 |
+
|
259 |
+
/**
|
260 |
+
* "Ping" the MailChimp API - a simple method you can call that will return a constant value as long as everything is good. Note
|
261 |
+
* than unlike most all of our methods, we don't throw an Exception if we are having issues. You will simply receive a different
|
262 |
+
* string back that will explain our view on what is going on.
|
263 |
+
*
|
264 |
+
* @section Helper
|
265 |
+
* @example xml-rpc_ping.php
|
266 |
+
*
|
267 |
+
* @return string returns "Everything's Chimpy!" if everything is chimpy, otherwise returns an error message
|
268 |
+
*/
|
269 |
+
function ping() {
|
270 |
+
$params = array();
|
271 |
+
return $this->callServer("ping", $params);
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Internal function - proxy method for certain XML-RPC calls | DO NOT CALL
|
276 |
+
* @param mixed Method to call, with any parameters to pass along
|
277 |
+
* @return mixed the result of the call
|
278 |
+
*/
|
279 |
+
function callMethod() {
|
280 |
+
$params = array();
|
281 |
+
return $this->callServer("callMethod", $params);
|
282 |
+
}
|
283 |
+
|
284 |
+
/**
|
285 |
+
* Actually connect to the server and call the requested methods, parsing the result
|
286 |
+
* You should never have to call this function manually
|
287 |
+
*/
|
288 |
+
function callServer($method, $params) {
|
289 |
+
$dc = "us1";
|
290 |
+
if (strstr($this->api_key,"-")){
|
291 |
+
list($key, $dc) = explode("-",$this->api_key,2);
|
292 |
+
if (!$dc) $dc = "us1";
|
293 |
+
}
|
294 |
+
$host = $dc.".".$this->apiUrl["host"];
|
295 |
+
$params["apikey"] = $this->api_key;
|
296 |
+
|
297 |
+
$this->errorMessage = "";
|
298 |
+
$this->errorCode = "";
|
299 |
+
$sep_changed = false;
|
300 |
+
//sigh, apparently some distribs change this to & by default
|
301 |
+
if (ini_get("arg_separator.output")!="&"){
|
302 |
+
$sep_changed = true;
|
303 |
+
$orig_sep = ini_get("arg_separator.output");
|
304 |
+
ini_set("arg_separator.output", "&");
|
305 |
+
}
|
306 |
+
$post_vars = $this->httpBuildQuery($params);
|
307 |
+
if ($sep_changed){
|
308 |
+
ini_set("arg_separator.output", $orig_sep);
|
309 |
+
}
|
310 |
+
|
311 |
+
$payload = "POST " . $this->apiUrl["path"] . "?" . $this->apiUrl["query"] . "&method=" . $method . " HTTP/1.0\r\n";
|
312 |
+
$payload .= "Host: " . $host . "\r\n";
|
313 |
+
$payload .= "User-Agent: MCAPIwp/" . $this->version ."\r\n";
|
314 |
+
$payload .= "Content-type: application/x-www-form-urlencoded\r\n";
|
315 |
+
$payload .= "Content-length: " . strlen($post_vars) . "\r\n";
|
316 |
+
$payload .= "Connection: close \r\n\r\n";
|
317 |
+
$payload .= $post_vars;
|
318 |
+
|
319 |
+
ob_start();
|
320 |
+
if ($this->secure){
|
321 |
+
$sock = fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
|
322 |
+
} else {
|
323 |
+
$sock = fsockopen($host, 80, $errno, $errstr, 30);
|
324 |
+
}
|
325 |
+
if(!$sock) {
|
326 |
+
$this->errorMessage = "Could not connect (ERR $errno: $errstr)";
|
327 |
+
$this->errorCode = "-99";
|
328 |
+
ob_end_clean();
|
329 |
+
return false;
|
330 |
+
}
|
331 |
+
|
332 |
+
$response = "";
|
333 |
+
fwrite($sock, $payload);
|
334 |
+
stream_set_timeout($sock, $this->timeout);
|
335 |
+
$info = stream_get_meta_data($sock);
|
336 |
+
while ((!feof($sock)) && (!$info["timed_out"])) {
|
337 |
+
$response .= fread($sock, $this->chunkSize);
|
338 |
+
$info = stream_get_meta_data($sock);
|
339 |
+
}
|
340 |
+
fclose($sock);
|
341 |
+
ob_end_clean();
|
342 |
+
if ($info["timed_out"]) {
|
343 |
+
$this->errorMessage = "Could not read response (timed out)";
|
344 |
+
$this->errorCode = -98;
|
345 |
+
return false;
|
346 |
+
}
|
347 |
+
|
348 |
+
list($headers, $response) = explode("\r\n\r\n", $response, 2);
|
349 |
+
$headers = explode("\r\n", $headers);
|
350 |
+
$errored = false;
|
351 |
+
foreach($headers as $h){
|
352 |
+
if (substr($h,0,26)==="X-MailChimp-API-Error-Code"){
|
353 |
+
$errored = true;
|
354 |
+
$error_code = trim(substr($h,27));
|
355 |
+
break;
|
356 |
+
}
|
357 |
+
}
|
358 |
+
|
359 |
+
if(ini_get("magic_quotes_runtime")) $response = stripslashes($response);
|
360 |
+
|
361 |
+
$serial = unserialize($response);
|
362 |
+
if($response && $serial === false) {
|
363 |
+
$response = array("error" => "Bad Response. Got This: " . $response, "code" => "-99");
|
364 |
+
} else {
|
365 |
+
$response = $serial;
|
366 |
+
}
|
367 |
+
if($errored && is_array($response) && isset($response["error"])) {
|
368 |
+
$this->errorMessage = $response["error"];
|
369 |
+
$this->errorCode = $response["code"];
|
370 |
+
return false;
|
371 |
+
} elseif($errored){
|
372 |
+
$this->errorMessage = "No error message was found";
|
373 |
+
$this->errorCode = $error_code;
|
374 |
+
return false;
|
375 |
+
}
|
376 |
+
|
377 |
+
return $response;
|
378 |
+
}
|
379 |
+
|
380 |
+
/**
|
381 |
+
* Re-implement http_build_query for systems that do not already have it
|
382 |
+
*/
|
383 |
+
function httpBuildQuery($params, $key=null) {
|
384 |
+
$ret = array();
|
385 |
+
|
386 |
+
foreach((array) $params as $name => $val) {
|
387 |
+
$name = urlencode($name);
|
388 |
+
if($key !== null) {
|
389 |
+
$name = $key . "[" . $name . "]";
|
390 |
+
}
|
391 |
+
|
392 |
+
if(is_array($val) || is_object($val)) {
|
393 |
+
$ret[] = $this->httpBuildQuery($val, $name);
|
394 |
+
} elseif($val !== null) {
|
395 |
+
$ret[] = $name . "=" . urlencode($val);
|
396 |
+
}
|
397 |
+
}
|
398 |
+
|
399 |
+
return implode("&", $ret);
|
400 |
+
}
|
401 |
+
|
402 |
+
}
|
403 |
+
?>
|
po/mailchimp_i18n-da_DK.mo
ADDED
Binary file
|
po/mailchimp_i18n-da_DK.po
ADDED
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR MailChimp API Support Team
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: MailChimp 1.1.5\n"
|
9 |
+
"Report-Msgid-Bugs-To: http://wordpress.org/tag/mailchimp\n"
|
10 |
+
"POT-Creation-Date: 2009-07-15 14:23-0400\n"
|
11 |
+
"PO-Revision-Date: 2011-02-09 16:57-0500\n"
|
12 |
+
"Last-Translator: MailChimp API <api@mailchimp.com>\n"
|
13 |
+
"Language-Team: Jan <LL@li.org>\n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"X-Poedit-Language: Danish\n"
|
18 |
+
"X-Poedit-Country: DENMARK\n"
|
19 |
+
|
20 |
+
#: mailchimp_includes.php:27
|
21 |
+
#: mailchimp_includes.php:62
|
22 |
+
msgid "You must fill in %s."
|
23 |
+
msgstr "Du skal udfylde %s,"
|
24 |
+
|
25 |
+
#: mailchimp_includes.php:59
|
26 |
+
msgid "That email address is already subscribed to the list"
|
27 |
+
msgstr "Den email-adresse er allerede tilmeldt"
|
28 |
+
|
29 |
+
#: mailchimp_includes.php:66
|
30 |
+
#, php-format
|
31 |
+
msgid "%s has invalid content"
|
32 |
+
msgstr "%s har ugyldigt indhold"
|
33 |
+
|
34 |
+
#: mailchimp_includes.php:68
|
35 |
+
msgid "An invalid Interest Group was selected"
|
36 |
+
msgstr "En ugyldigt interessegruppe er valgt"
|
37 |
+
|
38 |
+
#: mailchimp_includes.php:69
|
39 |
+
msgid "That email address is invalid"
|
40 |
+
msgstr "Den email-adresse er ugyldig"
|
41 |
+
|
42 |
+
#: mailchimp_includes.php:75
|
43 |
+
msgid "Success, you've been signed up! Please look for our confirmation email!"
|
44 |
+
msgstr "Tillykke. Du er nu tilmeldt. Se efter om du har modtaget en bekræftelsesmail."
|
45 |
+
|
46 |
+
#: mailchimp_includes.php:131
|
47 |
+
msgid "required field"
|
48 |
+
msgstr "Obligatorisk felt"
|
49 |
+
|
50 |
+
#: mailchimp_includes.php:168
|
51 |
+
msgid "unsubscribe from list"
|
52 |
+
msgstr "Frameld listen"
|
53 |
+
|
54 |
+
#: mailchimp_includes.php:171
|
55 |
+
msgid "powered by"
|
56 |
+
msgstr "Drevet af"
|
57 |
+
|
58 |
+
#: mailchimp.php:135
|
59 |
+
msgid "MailChimp Setup"
|
60 |
+
msgstr "MailChimp Setup"
|
61 |
+
|
62 |
+
#: mailchimp.php:150
|
63 |
+
msgid "While upgrading the plugin setup, we were unable to login to your account. You will need to login again and setup your list."
|
64 |
+
msgstr "Under opgraderingen af plugin setuppet, var det ikke muligt at logge på din konto. Du er nødt til at logge på igen og sætte din liste op."
|
65 |
+
|
66 |
+
#: mailchimp.php:156
|
67 |
+
msgid "MailChimp List Setup"
|
68 |
+
msgstr "MailChimp Liste Setup"
|
69 |
+
|
70 |
+
#: mailchimp.php:166
|
71 |
+
msgid "Success! We were able to verify your username & password! Let's continue, shall we?"
|
72 |
+
msgstr "Tillykke. Vi kunne verificere dit brugernavn og password. Lad os fortsætte..."
|
73 |
+
|
74 |
+
#: mailchimp.php:178
|
75 |
+
msgid "Uh-oh, we were unable to login and verify your username & password. Please check them and try again!"
|
76 |
+
msgstr "Ups! Vi kunne ikke logge på og verificere dit brugernavn og password. Kontrollér venligst at de er rigtige og prøv igen."
|
77 |
+
|
78 |
+
#: mailchimp.php:179
|
79 |
+
msgid "The server said:"
|
80 |
+
msgstr "Serveren meldte:"
|
81 |
+
|
82 |
+
#: mailchimp.php:222
|
83 |
+
msgid "Sign up for"
|
84 |
+
msgstr "Tilmeld dig til"
|
85 |
+
|
86 |
+
#: mailchimp.php:223
|
87 |
+
msgid "Subscribe"
|
88 |
+
msgstr "Abbonnér"
|
89 |
+
|
90 |
+
#: mailchimp.php:253
|
91 |
+
#, php-format
|
92 |
+
msgid "Success! Loaded and saved the info for %d Merge Variables and %d Interest Groups from your list"
|
93 |
+
msgstr "Success! Loaded and saved the info for %d Merge Variables and %d Interest Groups from your list"
|
94 |
+
|
95 |
+
#: mailchimp.php:256
|
96 |
+
msgid "Now you should either Turn On the MailChimp Widget or change your options below, then turn it on."
|
97 |
+
msgstr "Nu skal du enten slå MailChimp Widget til, eller ændre indstillignerne herunder, og derefter slå den til."
|
98 |
+
|
99 |
+
#: mailchimp.php:284
|
100 |
+
msgid "Successfully Reset your List selection... Now you get to pick again!"
|
101 |
+
msgstr "Du har nu resat dit listevalg... Nu kan du vælge igen!"
|
102 |
+
|
103 |
+
#: mailchimp.php:290
|
104 |
+
msgid "Monkey Rewards turned On!"
|
105 |
+
msgstr "Monkey Rewards er slået til!"
|
106 |
+
|
107 |
+
#: mailchimp.php:294
|
108 |
+
msgid "Monkey Rewards turned Off!"
|
109 |
+
msgstr "Monkey Rewards er slået fra!"
|
110 |
+
|
111 |
+
#: mailchimp.php:299
|
112 |
+
msgid "Fancy Javascript submission turned On!"
|
113 |
+
msgstr "Fancy Javascript tilmelding er slået til!"
|
114 |
+
|
115 |
+
#: mailchimp.php:303
|
116 |
+
msgid "Fancy Javascript submission turned Off!"
|
117 |
+
msgstr "Fancy Javascript tilmelding er slået fra!"
|
118 |
+
|
119 |
+
#: mailchimp.php:309
|
120 |
+
msgid "Unsubscribe link turned On!"
|
121 |
+
msgstr "Frameldingslink er slået til!"
|
122 |
+
|
123 |
+
#: mailchimp.php:313
|
124 |
+
msgid "Unsubscribe link turned Off!"
|
125 |
+
msgstr "Frameldingslink er slået fra!"
|
126 |
+
|
127 |
+
#: mailchimp.php:359
|
128 |
+
msgid "Successfully Updated your List Subscribe Form Settings!"
|
129 |
+
msgstr "Tilmeldingsindstillingerne er blevet opdateret."
|
130 |
+
|
131 |
+
#: mailchimp.php:372
|
132 |
+
msgid "Login Info"
|
133 |
+
msgstr "Login Info"
|
134 |
+
|
135 |
+
#: mailchimp.php:373
|
136 |
+
msgid "To start using the MailChimp plugin, we first need to login and get your API Key. Please enter your MailChimp username and password below."
|
137 |
+
msgstr "For at starte med at bruge MailChimp-plugin'et, skal vi først logge ind og hente din API-nøgle. Skriv venligtst dit brugernavn og password herudner."
|
138 |
+
|
139 |
+
#: mailchimp.php:375
|
140 |
+
msgid "Don't have a MailChimp account? <a href='http://www.mailchimp.com/tryit.phtml' target='_blank'>Try one for Free</a>!"
|
141 |
+
msgstr "Har du ikke en MailChimp Konto ? <a href='http://www.mailchimp.com/tryit.phtml' target='_blank'>Få een helt gratis</a>!"
|
142 |
+
|
143 |
+
#: mailchimp.php:379
|
144 |
+
msgid "Username"
|
145 |
+
msgstr "Brugernavn"
|
146 |
+
|
147 |
+
#: mailchimp.php:383
|
148 |
+
msgid "Password"
|
149 |
+
msgstr "Password"
|
150 |
+
|
151 |
+
#: mailchimp.php:389
|
152 |
+
msgid "Save & Check"
|
153 |
+
msgstr "Gem og kontrollér"
|
154 |
+
|
155 |
+
#: mailchimp.php:394
|
156 |
+
msgid "Notes"
|
157 |
+
msgstr "Noter"
|
158 |
+
|
159 |
+
#: mailchimp.php:395
|
160 |
+
msgid "Changing your settings at MailChimp.com may cause this to stop working."
|
161 |
+
msgstr "Hvis du ændrer dine instillinger på Mailchimp.com, kan du risikere at dette ikke virker længere."
|
162 |
+
|
163 |
+
#: mailchimp.php:396
|
164 |
+
msgid "If you change your login to a different account, the info you have setup below will be erased."
|
165 |
+
msgstr "Hvis du ændrer dit login til en anden konto, vil dit setup herunder blive slettet."
|
166 |
+
|
167 |
+
#: mailchimp.php:397
|
168 |
+
msgid "If any of that happens, no biggie - just reconfigure your login and the items below..."
|
169 |
+
msgstr "Hvis noget af det sker er det ikke noget problem. Du skal bare rekonfigurere dit login og indstillingerne herunder."
|
170 |
+
|
171 |
+
#: mailchimp.php:403
|
172 |
+
msgid "Logged in as"
|
173 |
+
msgstr "Logget ind som"
|
174 |
+
|
175 |
+
#: mailchimp.php:407
|
176 |
+
msgid "Logout"
|
177 |
+
msgstr "Log ud"
|
178 |
+
|
179 |
+
#: mailchimp.php:421
|
180 |
+
msgid "Your Lists"
|
181 |
+
msgstr "Dine Lister"
|
182 |
+
|
183 |
+
#: mailchimp.php:423
|
184 |
+
msgid "Please select the List you wish to create a Signup Form for."
|
185 |
+
msgstr "Vælg venligst den liste du vil lave en tilmeldingsform for."
|
186 |
+
|
187 |
+
#: mailchimp.php:432
|
188 |
+
#, php-format
|
189 |
+
msgid "Uh-oh, you don't have any lists defined! Please visit %s, login, and setup a list before using this tool!"
|
190 |
+
msgstr "Ups! Du har ikke defineret nogen lister. Besøg venlgst %s. login og lav en liste før du bruger dette værktø!"
|
191 |
+
|
192 |
+
#: mailchimp.php:437
|
193 |
+
msgid "Select A List"
|
194 |
+
msgstr "Vælg en liste"
|
195 |
+
|
196 |
+
#: mailchimp.php:450
|
197 |
+
msgid "Update List"
|
198 |
+
msgstr "Opdatér en liste"
|
199 |
+
|
200 |
+
#: mailchimp.php:453
|
201 |
+
msgid "Note:"
|
202 |
+
msgstr "Note:"
|
203 |
+
|
204 |
+
#: mailchimp.php:453
|
205 |
+
msgid "Updating your list will not cause settings below to be lost. Changing to a new list will."
|
206 |
+
msgstr "Hvis du opdaterer din liste vil dine indstillinger ikke blive tabt. Hvis du skifter liste vil de blive tabt."
|
207 |
+
|
208 |
+
#: mailchimp.php:471
|
209 |
+
msgid "Reset List Options and Select again"
|
210 |
+
msgstr "Nulstil listevalg og vælg igen."
|
211 |
+
|
212 |
+
#: mailchimp.php:474
|
213 |
+
msgid "Subscribe Form Widget Settings for this List"
|
214 |
+
msgstr "Denne listes indstillinger for tilmeldingsform-widget"
|
215 |
+
|
216 |
+
#: mailchimp.php:475
|
217 |
+
msgid "Selected MailChimp List"
|
218 |
+
msgstr "Valgt MailChimp Liste"
|
219 |
+
|
220 |
+
#: mailchimp.php:496
|
221 |
+
#: mailchimp.php:569
|
222 |
+
#: mailchimp.php:630
|
223 |
+
msgid "Update Subscribe Form Settings"
|
224 |
+
msgstr "Opdatér indstillinger for tilmeldingsformen"
|
225 |
+
|
226 |
+
#: mailchimp.php:499
|
227 |
+
msgid "Monkey Rewards"
|
228 |
+
msgstr "Monkey Rewards"
|
229 |
+
|
230 |
+
#: mailchimp.php:501
|
231 |
+
msgid "turning this on will place a \"powered by MailChimp\" link in your form that will earn you credits with us. It is optional and can be turned on or off at any time."
|
232 |
+
msgstr "Hvis denne er slået til bliver der andbragt et \"powered by MailChimp\" -link på din form, så du kan tjene credits. Det er valgfrit, og kan slås til og fra til enhver tid."
|
233 |
+
|
234 |
+
#: mailchimp.php:505
|
235 |
+
msgid "Use Javascript Support?"
|
236 |
+
msgstr "Vil du bruge Javascript?"
|
237 |
+
|
238 |
+
#: mailchimp.php:507
|
239 |
+
msgid "turning this on will use fancy javascript submission and should degrade gracefully for users not using javascript. It is optional and can be turned on or off at any time."
|
240 |
+
msgstr "Hvis denne er slået til bliver der brugt Fancy Javascript tilmeldiing, og burde aftage pænt for brugere der ikke bruger Javascript. Det er valgfrit, og kan slås til og fra til enhver tid."
|
241 |
+
|
242 |
+
#: mailchimp.php:511
|
243 |
+
msgid "Include Unsubscribe link?"
|
244 |
+
msgstr "Inkludér frameldingslink ?"
|
245 |
+
|
246 |
+
#: mailchimp.php:513
|
247 |
+
msgid "turning this on will add a link to your host unsubscribe form"
|
248 |
+
msgstr "Hvis denne er slået til, vil der blive tilføjet et link til din frameldingsform"
|
249 |
+
|
250 |
+
#: mailchimp.php:517
|
251 |
+
msgid "Header content"
|
252 |
+
msgstr "Header indhold"
|
253 |
+
|
254 |
+
#: mailchimp.php:520
|
255 |
+
msgid "You can fill this with your own Text, HTML markup (including image links), or Nothing!"
|
256 |
+
msgstr "Du kan udfylde denne med din egen tekst, HTML markup (inkl. links til billeder), eller ingenting!"
|
257 |
+
|
258 |
+
#: mailchimp.php:525
|
259 |
+
msgid "Submit Button text"
|
260 |
+
msgstr "Tilmeldingsknaptekst"
|
261 |
+
|
262 |
+
#: mailchimp.php:532
|
263 |
+
msgid "Custom Styling"
|
264 |
+
msgstr "Custom Styling"
|
265 |
+
|
266 |
+
#: mailchimp.php:536
|
267 |
+
msgid "Turned On?"
|
268 |
+
msgstr "Slået til?"
|
269 |
+
|
270 |
+
#: mailchimp.php:537
|
271 |
+
msgid "Header Settings (only applies if there are no HTML tags in the Header Content area above)"
|
272 |
+
msgstr "Headerinstillinger (bruges kun hvis der ikke er HTML tags i Header Indhold herover)"
|
273 |
+
|
274 |
+
#: mailchimp.php:538
|
275 |
+
#: mailchimp.php:552
|
276 |
+
msgid "Border Width"
|
277 |
+
msgstr "Kantbredde"
|
278 |
+
|
279 |
+
#: mailchimp.php:539
|
280 |
+
#: mailchimp.php:553
|
281 |
+
msgid "Set to 0 for no border, do not enter <strong>px</strong>!"
|
282 |
+
msgstr "Sættes til 0 hvis kant ikke ønskes. Skriv ikke <strong>px</strong>!"
|
283 |
+
|
284 |
+
#: mailchimp.php:541
|
285 |
+
#: mailchimp.php:555
|
286 |
+
msgid "Border Color"
|
287 |
+
msgstr "Kantfarve"
|
288 |
+
|
289 |
+
#: mailchimp.php:542
|
290 |
+
#: mailchimp.php:545
|
291 |
+
#: mailchimp.php:548
|
292 |
+
#: mailchimp.php:556
|
293 |
+
#: mailchimp.php:559
|
294 |
+
#: mailchimp.php:562
|
295 |
+
msgid "do not enter initial <strong>#</strong>"
|
296 |
+
msgstr "Indtast ikke det første <strong>#</strong>"
|
297 |
+
|
298 |
+
#: mailchimp.php:551
|
299 |
+
msgid "Form Settings"
|
300 |
+
msgstr "Form instillinger"
|
301 |
+
|
302 |
+
#: mailchimp.php:571
|
303 |
+
msgid "Merge Variables Included"
|
304 |
+
msgstr "Flettevariable inkulderede"
|
305 |
+
|
306 |
+
#: mailchimp.php:574
|
307 |
+
msgid "No Merge Variables found."
|
308 |
+
msgstr "Ingen flettevariable fundet."
|
309 |
+
|
310 |
+
#: mailchimp.php:580
|
311 |
+
#: mailchimp.php:614
|
312 |
+
msgid "Name"
|
313 |
+
msgstr "Navn"
|
314 |
+
|
315 |
+
#: mailchimp.php:581
|
316 |
+
msgid "Tag"
|
317 |
+
msgstr "Tag"
|
318 |
+
|
319 |
+
#: mailchimp.php:582
|
320 |
+
msgid "Required?"
|
321 |
+
msgstr "Obligatorisk?"
|
322 |
+
|
323 |
+
#: mailchimp.php:583
|
324 |
+
msgid "Include?"
|
325 |
+
msgstr "Inkludér?"
|
326 |
+
|
327 |
+
#: mailchimp.php:603
|
328 |
+
msgid "Interest Groups"
|
329 |
+
msgstr "Interessegrupper"
|
330 |
+
|
331 |
+
#: mailchimp.php:605
|
332 |
+
msgid "No Interest Groups Setup for this List"
|
333 |
+
msgstr "Der er ingen interessegrupper til denne liste"
|
334 |
+
|
335 |
+
#: mailchimp.php:610
|
336 |
+
msgid "Show?"
|
337 |
+
msgstr "Vis?"
|
338 |
+
|
339 |
+
#: mailchimp.php:617
|
340 |
+
msgid "Input Type"
|
341 |
+
msgstr "Input Type"
|
342 |
+
|
343 |
+
#: mailchimp.php:620
|
344 |
+
msgid "Options"
|
345 |
+
msgstr "Valgmuligheder"
|
346 |
+
|
readme.txt
CHANGED
@@ -2,12 +2,8 @@
|
|
2 |
Contributors: mc_jesse, crowdfavorite
|
3 |
Tags: mailchimp, email, newsletter, signup, marketing, plugin, widget
|
4 |
Requires at least: 2.8
|
5 |
-
Tested up to: 3.0.
|
6 |
-
Stable tag: 1.2.
|
7 |
-
Author URI: http://www.mailchimp.com/api/
|
8 |
-
Plugin URI: http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/
|
9 |
-
|
10 |
-
The MailChimp plugin allows you to quickly and easily add a signup form for your MailChimp list.
|
11 |
|
12 |
== Description ==
|
13 |
|
@@ -17,8 +13,6 @@ Not sure what [MailChimp](http://www.mailchimp.com/features/full_list/) is or if
|
|
17 |
|
18 |
After Installation, the setup page will guide you through entering your Login information, selecting your List from our Service, selecting options for the Merge Fields and Interest Groups you have setup, and then add the Widget to your site. The time from starting installation to have the form on your site should be less than 5 minutes - absolutely everything can be done via the Wordpress Setting GUI - no file editing at all!
|
19 |
|
20 |
-
You can also visit our [homepage for the plugin](http://www.mailchimp.com/plugins/mailchimp-wordpress-plugin/), but if you are reading this, you probably don't need to.
|
21 |
-
|
22 |
== Installation ==
|
23 |
|
24 |
This section describes how to install the plugin and get started using it.
|
@@ -63,6 +57,7 @@ Currently we have the plugin configured so it can be easily translated and the f
|
|
63 |
|
64 |
* bg_BG - Bulgarian in Bulgaria (thanks to [SiteGround](http://www.siteground.com/wordpress-hosting.htm) for contributing)
|
65 |
* cs_CZ - Czech in the Czech Republic (thanks to [Peter Kahoun](http://kahi.cz/) for contributing)
|
|
|
66 |
* de_DE - German in Germany (thanks to Michael Jaekel for contributing)
|
67 |
* en_US - English in the U.S.
|
68 |
* et_ET - Estonian in Estonia (thanks to [Helen Urbanik](http://www.motomaania.ee/) for contributing)
|
@@ -88,17 +83,18 @@ If your language is not listed above, feel free to create a translation. Here ar
|
|
88 |
|
89 |
= What in the world is MailChimp? =
|
90 |
|
91 |
-
Good question! [MailChimp](http://
|
92 |
|
93 |
-
To learn more, just check out our site: [MailChimp](http://
|
94 |
|
95 |
|
96 |
= Wait a minute, you want me to pay to try this? =
|
97 |
|
98 |
-
*Absolutely not!* We welcome you to come signup for a [FREE Trial Account](http://
|
99 |
|
100 |
= I want this in my language, do you have a translation? =
|
101 |
Maybe! Look in the /po/ directory in our plugin package and see if your language is in there. If it is, great! If it is not, feel from to create one. Here are the basic steps:
|
|
|
102 |
1. Copy "mailchimp_i18n-en_US.po" to "mailchimp_i18n-LANG_COUNTRY.po" - fill in LANG and COUNTRY with whatever you use for WPLANG in wp-config.php
|
103 |
2. Grab a translation editor. [POedit](http://www.poedit.net/) works for us
|
104 |
3. Translate each line - if you need some context, just open up mailchimp.php or mailchimp_widget.php and search for the line number or text
|
@@ -116,6 +112,9 @@ Maybe! Look in the /po/ directory in our plugin package and see if your language
|
|
116 |
|
117 |
== Changelog ==
|
118 |
|
|
|
|
|
|
|
119 |
= 1.2.1 =
|
120 |
* Fixed internationalization path bug.
|
121 |
* Fixed instances where i18n functions weren't necessary in admin.
|
2 |
Contributors: mc_jesse, crowdfavorite
|
3 |
Tags: mailchimp, email, newsletter, signup, marketing, plugin, widget
|
4 |
Requires at least: 2.8
|
5 |
+
Tested up to: 3.0.4
|
6 |
+
Stable tag: 1.2.2
|
|
|
|
|
|
|
|
|
7 |
|
8 |
== Description ==
|
9 |
|
13 |
|
14 |
After Installation, the setup page will guide you through entering your Login information, selecting your List from our Service, selecting options for the Merge Fields and Interest Groups you have setup, and then add the Widget to your site. The time from starting installation to have the form on your site should be less than 5 minutes - absolutely everything can be done via the Wordpress Setting GUI - no file editing at all!
|
15 |
|
|
|
|
|
16 |
== Installation ==
|
17 |
|
18 |
This section describes how to install the plugin and get started using it.
|
57 |
|
58 |
* bg_BG - Bulgarian in Bulgaria (thanks to [SiteGround](http://www.siteground.com/wordpress-hosting.htm) for contributing)
|
59 |
* cs_CZ - Czech in the Czech Republic (thanks to [Peter Kahoun](http://kahi.cz/) for contributing)
|
60 |
+
* da_DK - Danish in Denmark (thanks to Jan Lund for contributing)
|
61 |
* de_DE - German in Germany (thanks to Michael Jaekel for contributing)
|
62 |
* en_US - English in the U.S.
|
63 |
* et_ET - Estonian in Estonia (thanks to [Helen Urbanik](http://www.motomaania.ee/) for contributing)
|
83 |
|
84 |
= What in the world is MailChimp? =
|
85 |
|
86 |
+
Good question! [MailChimp](http://mailchimp.com/features/all/) is full of useful, powerful email marketing features that are easy to use and even a little fun (that's right---we said fun), whether you're an email marketing expert, or a small business just getting started.
|
87 |
|
88 |
+
To learn more, just check out our site: [MailChimp](http://mailchimp.com/features/all/)
|
89 |
|
90 |
|
91 |
= Wait a minute, you want me to pay to try this? =
|
92 |
|
93 |
+
*Absolutely not!* We welcome you to come signup for a [FREE Trial Account](http://mailchimp.com/signup/) and see if you find it useful.
|
94 |
|
95 |
= I want this in my language, do you have a translation? =
|
96 |
Maybe! Look in the /po/ directory in our plugin package and see if your language is in there. If it is, great! If it is not, feel from to create one. Here are the basic steps:
|
97 |
+
|
98 |
1. Copy "mailchimp_i18n-en_US.po" to "mailchimp_i18n-LANG_COUNTRY.po" - fill in LANG and COUNTRY with whatever you use for WPLANG in wp-config.php
|
99 |
2. Grab a translation editor. [POedit](http://www.poedit.net/) works for us
|
100 |
3. Translate each line - if you need some context, just open up mailchimp.php or mailchimp_widget.php and search for the line number or text
|
112 |
|
113 |
== Changelog ==
|
114 |
|
115 |
+
= 1.2.2 =
|
116 |
+
* Change MCAPI wrapper to use a more unique class name, v1.3 of the API, and a much lighter client library
|
117 |
+
|
118 |
= 1.2.1 =
|
119 |
* Fixed internationalization path bug.
|
120 |
* Fixed instances where i18n functions weren't necessary in admin.
|