Skip to content

Commit f576bed

Browse files
committed
V21.12.1 - 2021-12-21
1 parent 63d9596 commit f576bed

File tree

8 files changed

+569
-55
lines changed

8 files changed

+569
-55
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
// Generated file. Do not edit by hand. Use update.php in project root.
4+
5+
namespace PHPFUI\ConstantContact\Definition;
6+
7+
/**
8+
* @var string $alternative_subject The alternate email subject line to use for A/B testing.
9+
* @var int $test_size The percentage of contact recipients to participate in the A/B Test. For example, if the value is 30, then 30% of contacts will receive the email campaign with subject line A, and 30% of contacts will receive the email campaign with subject line B. Valid values include <code>5</code> to <code>50</code> percent. Currently, A/B tests support subject line only.
10+
* @var int $winner_wait_duration The number of hours Constant Contact waits after the A/B test is sent before determining the winning subject line. The winner is the subject line with the highest number of contact opens. After the winner is determined, Constant Contact automatically sends the email campaign with the winning subject line to all the remaining contacts, which did not participate in the A/B test.
11+
*/
12+
class ABTestData extends \PHPFUI\ConstantContact\Definition\Base
13+
{
14+
protected static array $fields = [
15+
'alternative_subject' => 'string',
16+
'test_size' => 'int',
17+
'winner_wait_duration' => 'int',
18+
19+
];
20+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
// Generated file. Do not edit by hand. Use update.php in project root.
4+
5+
namespace PHPFUI\ConstantContact\Definition;
6+
7+
/**
8+
* @var string $resend_subject The subject line for the resend email.
9+
* @var int $delay_days The number of days to wait before Constant Contact resends the email. Valid values include <code>1</code> to <code>10</code> days. This property is mutually exclusive with <code>delay_minutes</code>. This value is only returned in the response results if the resend activity was created with <code>delay_days</code> or the <code>delay_minutes</code> equal to an exact day value.
10+
* @var int $delay_minutes The number of minutes to wait before Constant Contact resends the email. There are 1,440 minutes in a day. Valid values includes a minimum of <code>720</code> (12 hours) and a maximum of <code>14,400</code> minutes (10 days). This property is mutually exclusive with <code>delay_days</code>.
11+
* @var DateTime $resend_date The system generated ISO-8601 format date and time that Constant Contact resent the email to non-openers.
12+
* @var string $resend_request_id For scheduled or sent resend to non-opener emails, this property is a unique identifier for the resend. For draft email campaign resend activities, the value of this property is <code>DRAFT</code>.
13+
*/
14+
class ResendToNonOpenersObject extends \PHPFUI\ConstantContact\Definition\Base
15+
{
16+
protected static array $fields = [
17+
'resend_subject' => 'string',
18+
'delay_days' => 'int',
19+
'delay_minutes' => 'int',
20+
'resend_date' => 'DateTime',
21+
'resend_request_id' => 'string',
22+
23+
];
24+
}

src/ConstantContact/V3/Activities/ContactExports.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,16 @@ public function __construct(\PHPFUI\ConstantContact\Client $client)
1414
/**
1515
* Export Contacts to a File
1616
*
17-
* Use this method to create an activity that exports contacts to a CSV
18-
* file. After Constant Contact finishes processing the activity, use the
19-
* `results` link in the response body to retrieve the CSV file.
17+
* Use this method to create an activity that exports contacts and contact
18+
* details to a CSV file. By default, all contacts are exported. To filter
19+
* contacts to export, specify the source to use, `contact_id`, `list_id`,
20+
* or `segment_id` (all mutually exclusive).
21+
* By default, all contact related fields are exported. Use the fields
22+
* array to only export specific contact fields. You must export `email_address`
23+
* to successfully export `email_optin_source`, `email_optin_date`, `email_optout_source`,
24+
* `email_optout_date`, or `email_optout_reason`.
25+
* After Constant Contact finishes processing the activity, use the `results`
26+
* link in the response body to retrieve the CSV file.
2027
*
2128
* @param \PHPFUI\ConstantContact\Definition\ContactsExport $body A JSON payload that specifies the contacts (rows in the CSV file) and contact properties (columns in the CSV file) you want to export.
2229
*/
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?php
2+
3+
// Generated file. Do not edit by hand. Use update.php in project root.
4+
5+
namespace PHPFUI\ConstantContact\V3\Emails\Activities;
6+
7+
class Abtest extends \PHPFUI\ConstantContact\Base
8+
{
9+
public function __construct(\PHPFUI\ConstantContact\Client $client)
10+
{
11+
parent::__construct($client, '/v3/emails/activities/{campaign_activity_id}/abtest');
12+
}
13+
14+
/**
15+
* GET A/B Test Details for an Email Campaign Activity
16+
*
17+
* Use this method to get A/B test details for a primary email campaign
18+
* activity, such as the alternate email subject line, the contact test
19+
* percentage size, and the number of hours to wait to determine the winning
20+
* subject line to use. Currently, A/B tests support subject line only.
21+
*
22+
*
23+
* @param string $campaign_activity_id The unique ID for the primary email campaign activity.
24+
*/
25+
public function get(string $campaign_activity_id) : array
26+
{
27+
28+
return $this->doGet(['campaign_activity_id' => $campaign_activity_id, ]);
29+
}
30+
31+
/**
32+
* DELETE an A/B Test for an Email Campaign Activity
33+
*
34+
* Deletes an A/B Test on an primary email campaign activity. You can only
35+
* delete A/B tests that have a `current_status` of `Draft`. Deleting an
36+
* A/B tests reverts the email campaign activity `type` from A/B Test (code=
37+
* `57`) back to NewsLetter (code= `10`). Constant Contact uses the original
38+
* subject line, rather than the alternate A/B test subject line, when
39+
* an A/B test is deleted.
40+
*
41+
* @param string $campaign_activity_id The unique ID for the primary email campaign activity.
42+
*/
43+
public function delete(string $campaign_activity_id) : bool
44+
{
45+
46+
return $this->doDelete(['campaign_activity_id' => $campaign_activity_id, ]);
47+
}
48+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
// Generated file. Do not edit by hand. Use update.php in project root.
4+
5+
namespace PHPFUI\ConstantContact\V3\Emails\Activities;
6+
7+
class NonOpenerResend extends \PHPFUI\ConstantContact\Base
8+
{
9+
public function __construct(\PHPFUI\ConstantContact\Client $client)
10+
{
11+
parent::__construct($client, '/v3/emails/activities/{campaign_activity_id}/non_opener_resends/{resend_request_id}');
12+
}
13+
14+
/**
15+
* DELETE a Resend to Non Openers Activity
16+
*
17+
* Use this `DELETE` method to delete (unschedule) a resend to non openers
18+
* activity.
19+
*
20+
* @param string $campaign_activity_id The unique ID for the primary email campaign activity.
21+
* @param string $resend_request_id The unique ID associated with the resend for the email campaign activity (for example: `389093`). If the email campaign activity is currently in draft status, specify `DRAFT` as the ID.
22+
*/
23+
public function delete(string $campaign_activity_id, string $resend_request_id) : bool
24+
{
25+
26+
return $this->doDelete(['campaign_activity_id' => $campaign_activity_id, 'resend_request_id' => $resend_request_id, ]);
27+
}
28+
}

src/ConstantContact/V3/Emails/Activities/NonOpenerResends.php

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ public function __construct(\PHPFUI\ConstantContact\Client $client)
1414
/**
1515
* GET Details for a Resend to Non-openers Campaign Activity
1616
*
17-
* Get details about a resend to non-openers campaign activity. If a resend
17+
* Get details about a resend to non-openers campaign activity. If resend
1818
* activity does not exist for the specified `campaign_activity_id`, an
1919
* empty list is returned in the results. You can only create one resend
20-
* activity per email campaign.
20+
* activity per email campaign.
2121
*
2222
* @param string $campaign_activity_id The unique ID for the primary email campaign activity.
2323
*/
@@ -26,4 +26,31 @@ public function get(string $campaign_activity_id) : array
2626

2727
return $this->doGet(['campaign_activity_id' => $campaign_activity_id, ]);
2828
}
29+
30+
/**
31+
* POST a Resend to Non-openers Campaign Activity
32+
*
33+
* Use this POST method to resend a primary campaign activity to contacts
34+
* that did not open a campaign activity that has a current `status` of
35+
* `Draft`, `Scheduled`, or `Done`. You can only create one resend activity
36+
* per email campaign.
37+
*
38+
* After an email campaign activity is sent to contacts, Constant Contact
39+
* waits the specified number of `delay_days` or `delay_minutes` (properties
40+
* are mutually exclusive) before resending to non-openers. If you set
41+
* both `delay_days` or `delay_minutes`, `delay_minutes` is ignored in
42+
* the request. You can resend to non-openers a minimum of twelve hours
43+
* (720 minutes) and a maximum of up to 10 days (or 10 x 1440 minutes)
44+
* after the initial send date.
45+
*
46+
*
47+
*
48+
* @param string $campaign_activity_id The unique ID for the primary email campaign activity.
49+
* @param \PHPFUI\ConstantContact\Definition\ResendToNonOpenersInput $resend_schedule A JSON request body that specifies when to resend the campaign activity to non-openers.
50+
*/
51+
public function post(string $campaign_activity_id, \PHPFUI\ConstantContact\Definition\ResendToNonOpenersInput $resend_schedule) : array
52+
{
53+
54+
return $this->doPost(['campaign_activity_id' => $campaign_activity_id, 'resend_schedule' => $resend_schedule->getData(), ]);
55+
}
2956
}

src/ConstantContact/V3/Partner/Accounts.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,32 @@ public function __construct(\PHPFUI\ConstantContact\Client $client)
1616
*
1717
* Get all Constant Contact client accounts managed under your technology
1818
* partner account. Use the `limit` query parameter to set the number of
19-
* accounts to return on each results page.
19+
* accounts to return on each results page. Use the `account_type` query
20+
* parameter to filter client account results by type: `all` (default),
21+
* `managed`, or `unmanaged`.
2022
* Only technology partners can access partner endpoints and partner endpoints
2123
* cannot be tested using the API reference tester.
2224
* For more use case information, see [Get all Partner Client Accounts](https://v3.developer.constantcontact.com/api_guide/partners_accts_get.html)
2325
* in the API guide.
2426
*
2527
* @param string $offset Depending on the `limit` you specify, the system determines the `offset` parameter to use (number of records to skip) and includes it in the link used to get the next page of results
2628
* @param string $limit The number of client accounts to return on each page of results. The default value is `50`. Entering a `limit` value less than the minimum (`10`) or greater than the maximum (`50`) is ignored and the system uses the default values. Depending on the `limit` you specify, the system determines the `offset` parameter to use (number of records to skip) and includes it in the link used to get the next page of results.
29+
* @param string $account_type Filters client account results by account type: `all` (default), `managed`, or `unmanaged`. Excluding the `account_type` query parameter returns all client accounts for the partner.
2730
*/
28-
public function get(?string $offset = null, ?string $limit = null) : array
31+
public function get(?string $offset = null, ?string $limit = null, ?string $account_type = null) : array
2932
{
3033

31-
return $this->doGet(['offset' => $offset, 'limit' => $limit, ]);
34+
if (null !== $account_type)
35+
{
36+
$validValues = ['all', 'managed', 'unmanaged'];
37+
38+
if (! \in_array($account_type, $validValues))
39+
{
40+
throw new \PHPFUI\ConstantContact\Exception\InvalidValue("Parameter account_type with value '{$account_type}' is not one of (" . \implode(', ', $validValues) . ') in ' . __METHOD__);
41+
}
42+
}
43+
44+
return $this->doGet(['offset' => $offset, 'limit' => $limit, 'account_type' => $account_type, ]);
3245
}
3346

3447
/**

0 commit comments

Comments
 (0)