Skip to content

Commit ec9eb58

Browse files
committed
V25.2.0 - 2025-02-15
1 parent d08926f commit ec9eb58

18 files changed

+610
-246
lines changed

src/ConstantContact/Definition/ActivityDeleteListResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<li>failed - job failed to complete</li>
1616
<li>timed_out - the request timed out before completing"</li>
1717
* </ul> </p>
18-
* @property \PHPFUI\ConstantContact\DateTime $created_at Date and time that the request was received, in ISO-8601 formmat.
18+
* @property \PHPFUI\ConstantContact\DateTime $created_at Date and time that the request was received, in ISO-8601 format.
1919
* @property \PHPFUI\ConstantContact\DateTime $updated_at Date and time that the request status was updated, in ISO-8601 format.
2020
* @property int $percent_done Job completion percentage
2121
* @property array $activity_errors Array of messages describing the errors that occurred.

src/ConstantContact/Definition/ContactCreateOrUpdateInput.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
* @property int $birthday_month The month value for the contact's birthday. Valid values are from 1 through 12. The <code>birthday_month</code> property is required if you use <code>birthday_day</code>.
1818
* @property int $birthday_day The day value for the contact's birthday. Valid values are from 1 through 31. The <code>birthday_day</code> property is required if you use <code>birthday_month</code>.
1919
* @property \PHPFUI\ConstantContact\Definition\StreetAddress $street_address
20+
* @property string $sms_channel The contact's SMS compatible phone number.
2021
*/
2122
class ContactCreateOrUpdateInput extends \PHPFUI\ConstantContact\Definition\Base
2223
{
@@ -33,6 +34,7 @@ class ContactCreateOrUpdateInput extends \PHPFUI\ConstantContact\Definition\Base
3334
'birthday_month' => 'int',
3435
'birthday_day' => 'int',
3536
'street_address' => '\PHPFUI\ConstantContact\Definition\StreetAddress',
37+
'sms_channel' => 'string',
3638

3739
];
3840

src/ConstantContact/Definition/ContactPostRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @property array<\PHPFUI\ConstantContact\UUID> $list_memberships Array of <code>list_id</code>s to which the contact is being subscribed, up to a maximum of 50.
2121
* @property array<\PHPFUI\ConstantContact\UUID> $taggings Array of tags (<code>tag_id</code>) assigned to the contact, up to a maximum of 50.
2222
* @property array<\PHPFUI\ConstantContact\Definition\Note> $notes An array of notes about the contact.
23+
* @property \PHPFUI\ConstantContact\Definition\ContactSmsChannel $sms_channel
2324
*/
2425
class ContactPostRequest extends \PHPFUI\ConstantContact\Definition\Base
2526
{
@@ -39,6 +40,7 @@ class ContactPostRequest extends \PHPFUI\ConstantContact\Definition\Base
3940
'list_memberships' => 'array<\PHPFUI\ConstantContact\UUID>',
4041
'taggings' => 'array<\PHPFUI\ConstantContact\UUID>',
4142
'notes' => 'array<\PHPFUI\ConstantContact\Definition\Note>',
43+
'sms_channel' => '\PHPFUI\ConstantContact\Definition\ContactSmsChannel',
4244

4345
];
4446

src/ConstantContact/Definition/ContactPutRequest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @property array<\PHPFUI\ConstantContact\UUID> $list_memberships Array of up to 50 <code>list_ids</code> to which the contact is subscribed.
2121
* @property array<\PHPFUI\ConstantContact\UUID> $taggings Array of tags (<code>tag_id</code>) assigned to the contact, up to a maximum of 50.
2222
* @property array<\PHPFUI\ConstantContact\Definition\Note> $notes An array of notes about the contact listed by most recent note first.
23+
* @property \PHPFUI\ConstantContact\Definition\ContactSmsChannel $sms_channel
2324
*/
2425
class ContactPutRequest extends \PHPFUI\ConstantContact\Definition\Base
2526
{
@@ -39,6 +40,7 @@ class ContactPutRequest extends \PHPFUI\ConstantContact\Definition\Base
3940
'list_memberships' => 'array<\PHPFUI\ConstantContact\UUID>',
4041
'taggings' => 'array<\PHPFUI\ConstantContact\UUID>',
4142
'notes' => 'array<\PHPFUI\ConstantContact\Definition\Note>',
43+
'sms_channel' => '\PHPFUI\ConstantContact\Definition\ContactSmsChannel',
4244

4345
];
4446

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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+
* @property array<\PHPFUI\ConstantContact\UUID> $list_ids Array of list id values. Constant Contact adds the resubscribed contact to the contact lists you provide in the array.
9+
*/
10+
class ContactResubscribeRequest extends \PHPFUI\ConstantContact\Definition\Base
11+
{
12+
protected static array $fields = [
13+
'list_ids' => 'array<\PHPFUI\ConstantContact\UUID>',
14+
15+
];
16+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
* @property string $full_sms_address The SMS-capable phone number for the Contact, including the dial code
9+
* @property array<\PHPFUI\ConstantContact\Definition\ContactSmsChannelConsents> $sms_channel_consents The consents for the SMS Channel.
10+
*/
11+
class ContactSmsChannel extends \PHPFUI\ConstantContact\Definition\Base
12+
{
13+
protected static array $fields = [
14+
'full_sms_address' => 'string',
15+
'sms_channel_consents' => 'array<\PHPFUI\ConstantContact\Definition\ContactSmsChannelConsents>',
16+
17+
];
18+
}
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+
* @property string $sms_consent_permission The current status of the SMS channel.
9+
* @property string $consent_type The type of consent provided.
10+
* @property string $consent_medium_details Additional information about the consent such as the type of device used.
11+
*/
12+
class ContactSmsChannelConsents extends \PHPFUI\ConstantContact\Definition\Base
13+
{
14+
protected static array $fields = [
15+
'sms_consent_permission' => 'string',
16+
'consent_type' => 'string',
17+
'consent_medium_details' => 'string',
18+
19+
];
20+
}

src/ConstantContact/Definition/HistoryDetails.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* @property string $consent_action_type The type of consent action provided.
1313
* @property string $consent_medium_type The code representing the medium used to provide consent. Medium types include mobile device (<code>MD</code>). lead generation form(<code>LF</code>), deactivation by carrier(<code>CD</code>), import_file:(<code>FI</code>), and system (<code>SY</code>).
1414
* @property string $source_consent_timestamp The time that SMS consent was last updated.
15-
* @property string $source_ip If applicable, the IP address from which the consent came.
1615
* @property string $source_sms_number If applicable, the SMS consent number associated with the source.
1716
* @property int $advertised_frequency If applicable, the advertising numeric component used to advertise to the contact.. For example, if <code>advertised_frequency</code> is set to <code> 2</code> , and <code>advertised_interval</code> is set to <code>M</code>, the contact receives advertisements twice a month.
1817
* @property string $advertised_interval If applicable, the interval component used to advertise to the contact. For example, if <code>advertised_frequency</code> is set to <code> 2</code> , and <code>advertised_interval</code> is set to <code>M</code>, the contact receives advertisements twice a month.
@@ -27,7 +26,6 @@ class HistoryDetails extends \PHPFUI\ConstantContact\Definition\Base
2726
'consent_action_type' => 'string',
2827
'consent_medium_type' => 'string',
2928
'source_consent_timestamp' => 'string',
30-
'source_ip' => 'string',
3129
'source_sms_number' => 'string',
3230
'advertised_frequency' => 'int',
3331
'advertised_interval' => 'string',
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
* @property string $sms_address The contact's SMS-capable phone number, excluding the country code.
9+
* @property string $dial_code The dial code the country uses. For example, use <code>1</code> for the United States dial code.
10+
* @property string $country_code The two-digit code that identifies the country.
11+
* @property array<\PHPFUI\ConstantContact\Definition\JmmlSmsChannelConsents> $sms_channel_consents The consents provided for the SMS Channel.
12+
*/
13+
class JmmlSmsChannel extends \PHPFUI\ConstantContact\Definition\Base
14+
{
15+
protected static array $fields = [
16+
'sms_address' => 'string',
17+
'dial_code' => 'string',
18+
'country_code' => 'string',
19+
'sms_channel_consents' => 'array<\PHPFUI\ConstantContact\Definition\JmmlSmsChannelConsents>',
20+
21+
];
22+
}
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\Definition;
6+
7+
/**
8+
* @property string $sms_consent_permission The current consent status of the SMS Channel.
9+
* @property string $consent_type The type of consent provided.
10+
* @property string $consent_medium_type A code representing where the consent was retrieved.
11+
* @property string $consent_medium_url The URL for which the consent was gathered, such as a landing page.
12+
* @property string $consent_medium_details Additional information for the consent
13+
* @property int $advertised_frequency The numeric component used to indicate how often to send advertising. For example, <code>1</code> indicates once. Use with <code>advertised_internal</code> property to indicate when on the calender to send it. For example, to send once (<code>1</code>) daily, weekly, or monthly.
14+
* @property string $advertised_interval The calender interval used to indicate when advertising is sent. For example <code>weekly</code>.
15+
*/
16+
class JmmlSmsChannelConsents extends \PHPFUI\ConstantContact\Definition\Base
17+
{
18+
protected static array $fields = [
19+
'sms_consent_permission' => 'string',
20+
'consent_type' => 'string',
21+
'consent_medium_type' => 'string',
22+
'consent_medium_url' => 'string',
23+
'consent_medium_details' => 'string',
24+
'advertised_frequency' => 'int',
25+
'advertised_interval' => 'string',
26+
27+
];
28+
}

src/ConstantContact/Definition/JsonImportContact.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace PHPFUI\ConstantContact\Definition;
66

77
/**
8-
* @property string $email The email address of the contact. This method identifies each unique contact using their email address.
8+
* @property string $email The email address of the contact. This method identifies each unique contact using their email address. Required if `sms_number` is not specified.
99
* @property string $first_name The first name of the contact.
1010
* @property string $last_name The last name of the contact.
1111
* @property string $job_title The job title of the contact.
@@ -43,8 +43,8 @@
4343
* @property string $other_zip The zip or postal code associated with the contact's other address.
4444
* @property string $other_country The name of another country where the contact is located.
4545
* @property string $cf:custom_field_name The name of this property is dynamic based on the custom fields you want to import. Use a key-value pair where the key is an existing custom field name prefixed with <code>cf:</code>, and the value is a custom field string value. For example, if you have a custom field named <code>first_name</code> you can use <code>"cf:first_name":"Joe"</code>. Each contact can contain up to 25 different custom fields.
46-
* @property string $sms_number The US phone number to associate with the contact's SMS-enabled phone. The country code must be valid. Valid formats are <code>1231231234</code> or <code>123-123-1234</code>.
47-
* @property string $sms_consent_date Required if the SMS permission is set to `explict`. The date that the contact consented to receiving SMS messages. Valid date formats are MM/DD/YYYY, M/D/YYYY, YYYY/MM/DD, YYYY/M/D, YYYY-MM-DD, YYYY-M-D,M-D-YYYY, or M-DD-YYYY .
46+
* @property string $sms_number The US phone number to associate with the contact's SMS-enabled phone. The country code must be valid. Valid formats are <code>1231231234</code> or <code>123-123-1234</code>. Required if `email` is not specified.
47+
* @property string $sms_consent_date Required if the SMS permission is set to `explicit`. The date that the contact consented to receiving SMS messages. Valid date formats are MM/DD/YYYY, M/D/YYYY, YYYY/MM/DD, YYYY/M/D, YYYY-MM-DD, YYYY-M-D,M-D-YYYY, or M-DD-YYYY.
4848
*/
4949
class JsonImportContact extends \PHPFUI\ConstantContact\Definition\Base
5050
{

src/ConstantContact/V3/Activities/ContactsFileImport.php

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,52 @@ public function __construct(\PHPFUI\ConstantContact\Client $client)
1818
* or updates contacts by importing a CSV file containing contact information.
1919
* Do not use a Content-Type header value with this method.
2020
*
21-
* Importing a new contact automatically sets the contact's `permission_to_send`
22-
* property as `implicit` and the `opt_in_source` property as `Account`.
23-
* Importing an existing contact only updates the contact properties you
24-
* include in the request.
21+
* Importing a new contact email address automatically sets the contact's
22+
* `permission_to_send` property as `implicit` and the `opt_in_source`
23+
* property as `Account`. Importing an existing contact only updates the
24+
* contact properties you include in the request.
25+
* Importing contacts with `sms_number`s requires using the `sms_permission_to_send`
26+
* parameter to specify permissions for all contacts being imported. Set
27+
* to `explicit` to specify that all contacts either provided explicit
28+
* permission. Set to `not_set` if permission was not provided. If `explicit`,
29+
* you must also include the `sms_consent_date` as a column header to include
30+
* the date the contact consented to receiving SMS messages.
31+
* Contacts must have either an email address or an SMS number defined.
32+
*
2533
*
2634
* The CSV file has a maximum of 40,000 lines including the header row
2735
* (39,999 contacts) and a maximum file size of 4 megabytes (MB). Lines
2836
* above the 40,000 line maximum are not processed. If the request body
2937
* exceeds 4 MB, only the contacts contained in the first 4 MB are imported
3038
* and the remaining data is dropped.
3139
*
32-
* @param string $file The CSV file you are importing. The column headings that you can use in the file are: `first_name`, `last_name`, `email`, `phone`, `job_title`, `anniversary`, `birthday_day`, `birthday_month`, `company_name`, `street`, `street2`, `city`, `state`, `zip`, and `country`. The only required column heading is `email`.
40+
* @param string $file The CSV file you are importing must include either `email` or `sms_number` as a column heading. Other properties you can include using column headings are: `first_name`. `last_name`, `phone`, `job_title`, `anniversary`, `birthday_day`, `birthday_month`, `company_name`, `street`, `street2`, `city`, `state`, `zip`, `country`, and `sms_consent_date`.
41+
42+
If adding an `sms_number`, you must also include the `sms_permission_to_send` parameter and set it to either `not_set` or `explicit`. If `explicit`, requires including `sms_consent_date` as a column header to specify the date the contact consented to receiving SMS messages.
3343
3444
You can also use custom fields as column headings. Enter the custom field name prefixed with `cf:` as the column heading. For example, use `cf:first_name` as the header name if you have a custom field named "first_name". The custom field must already exist in the Constant Contact account you are using. Depending on the custom field data type, you can enter dates or strings as the value of the custom field. Each contact can contain up to 25 different custom fields.
3545
* @param array $list_ids Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact `list_id` values.
46+
* @param string $sms_permission_to_send If importing contact `sms_number`s, use this parameter to specify how SMS consent was provided. If all contacts in the file provided their consent, set to `explicit` and include each contact's `sms_consent_date`. If all contacts in the file have not yet provided consent, set to `not_set` (`sms_consent_date` is not required). You cannot message a contact that does not have a sms consent date set.
3647
*/
37-
public function post(string $file, array $list_ids) : ?array
48+
public function post(string $file, array $list_ids, ?string $sms_permission_to_send = null) : ?array
3849
{
3950

40-
return $this->doPost(['file' => $file, 'list_ids' => $list_ids, ]);
51+
if (null !== $sms_permission_to_send)
52+
{
53+
$validValues = ['not_set', 'explicit'];
54+
55+
if (! \in_array($sms_permission_to_send, $validValues))
56+
{
57+
throw new \PHPFUI\ConstantContact\Exception\InvalidValue("Parameter sms_permission_to_send with value '{$sms_permission_to_send}' is not one of (" . \implode(', ', $validValues) . ') in ' . __METHOD__);
58+
}
59+
}
60+
61+
return $this->doPost(['file' => $file, 'list_ids' => $list_ids, 'sms_permission_to_send' => $sms_permission_to_send, ]);
4162
}
4263

43-
public function postTyped(string $file, array $list_ids) : ?\PHPFUI\ConstantContact\Definition\ActivityImport
64+
public function postTyped(string $file, array $list_ids, ?string $sms_permission_to_send = null) : ?\PHPFUI\ConstantContact\Definition\ActivityImport
4465
{
45-
$data = $this->post($file, $list_ids);
66+
$data = $this->post($file, $list_ids, $sms_permission_to_send);
4667

4768
return $data ? new \PHPFUI\ConstantContact\Definition\ActivityImport($data) : null;
4869
}

src/ConstantContact/V3/Activities/ContactsJsonImport.php

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,38 @@ public function __construct(\PHPFUI\ConstantContact\Client $client)
1818
* contacts or updates existing contacts by importing a JSON payload. This
1919
* method requires a request body that contains the contact data you are
2020
* importing and the contact lists to which you want to add the imported
21-
* contacts.
22-
* Importing a new contact automatically sets the contact's `permission_to_send`
23-
* property as `implicit` and the `opt_in_source` property as `Account`.
24-
* Importing an existing contact only updates the contact properties you
25-
* include in the request.
26-
* For each contact, you can import up to three addresses and three phone
27-
* numbers. International phone numbers are currently not supported.
21+
* contacts. A contact's data must include an `email` address and/or `sms_number`.
22+
* The `sms_number` must be a US phone number to associate with the contact's
23+
* SMS-enabled phone. Valid formats are <code>1231231234</code> or <code>123-123-1234</code>
24+
* (the country code must be valid).
25+
*
26+
* Importing a new contact using this method automatically sets the contact's
27+
* email `permission_to_send` property to `implicit` and the `opt_in_source`
28+
* property as `Account`. Importing an existing contact only updates the
29+
* contact properties you include in the request. For each contact, you
30+
* can import up to three addresses and three phone numbers. International
31+
* phone numbers are currently not supported.
32+
*
2833
* To import custom fields, prefix the custom field name with `cf:` and
2934
* add it as a contact property. For example, use the property name `cf:first_name`
30-
* if you have a custom field named first_name. The custom field must already
31-
* exist in the Constant Contact account you are using. Each contact can
32-
* contain up to 25 custom fields.
35+
* if you have a custom field named `first_name`. The custom field must
36+
* already exist in the Constant Contact account you are using. Each contact
37+
* can contain up to 25 custom fields.
38+
*
39+
* To include a contact's `sms_number`, if the contact provided explicit
40+
* permission to receive SMS messages, you must set the `sms_permission_to_send`
41+
* property to `explicit` and specify the date of consent using the `sms_consent_date`
42+
* column header. If explicit permission was not provided, set `sms_permission_to_send`
43+
* to `not_set` (the `sms_consent_date` is not required). If the `sms_consent_date`
44+
* is not set, SMS messages cannot be sent to contacts and `sms_permission_to_send`
45+
* defaults to `not_set. Valid value formats for `sms_consent_date` include
46+
* MM/DD/YYYY, M/D/YYYY, YYYY/MM/DD, YYYY/M/D, YYYY-MM-DD, YYYY-M-D,M-D-YYYY,
47+
* or M-DD-YYYY.
3348
*
3449
* The request body payload has a maximum size of 4 megabytes (MB). If
3550
* the request body exceeds 4 MB, this method only imports the first 4
36-
* MB and drops the remaining data.
37-
* Use the activity URL to check the status of the import activity request.
38-
*
51+
* MB and drops the remaining data. Use the activity URL to check the status
52+
* of the import activity request.
3953
*
4054
* @param \PHPFUI\ConstantContact\Definition\ContactsJsonImport $body The JSON request payload that contains the contact data and contact lists for the import.
4155
*/

0 commit comments

Comments
 (0)