Skip to content

Commit

Permalink
V24.8.0 - 2024-08-30
Browse files Browse the repository at this point in the history
  • Loading branch information
phpfui committed Aug 30, 2024
1 parent 5159924 commit 3e20ba3
Show file tree
Hide file tree
Showing 7 changed files with 167 additions and 58 deletions.
2 changes: 1 addition & 1 deletion src/ConstantContact/Definition/ContactsExport.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @property array<\PHPFUI\ConstantContact\UUID> $list_ids Exports all of the contacts inside of up to 50 contact lists. This property is mutually exclusive with <code>contact_ids</code>.
* @property int $segment_id Specify the <code>segment_id</code> from which you want to export all contacts that meet the specified <code>segment_criteria</code>. This property is mutually exclusive with <code>contact_ids</code> and <code>list_ids</code>. You can only specify one <code>segment_id</code>.
* @property array $fields Use this array to export specific contact fields. You must export <code>email_address</code> to successfully export <code>email_optin_source</code>, <code>email_optin_date</code>, <code>email_optout_source</code>, <code>email_optout_date</code>, or <code>email_optout_reason</code>.
* @property string $status Allows you to export only contacts that have a specific status value. Possible values are <code>active</code> (billable), <code>unsubscribed</code>, or <code>removed</code>
* @property string $status Allows you to export only contacts that have a specific status value. Possible values are <code>active</code> (billable), <code>unsubscribed</code>, or <code>removed</code>. Applicable with either `contact_ids` or `list_ids` as the source.
*/
class ContactsExport extends \PHPFUI\ConstantContact\Definition\Base
{
Expand Down
2 changes: 2 additions & 0 deletions src/ConstantContact/Definition/ContactsJsonImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
/**
* @property array<\PHPFUI\ConstantContact\Definition\JsonImportContact> $import_data An array containing the contacts to import.
* @property array<\PHPFUI\ConstantContact\UUID> $list_ids Specify which contact lists you are adding all imported contacts to as an array of up to 50 contact <code>list_id</code> string values.
* @property string $sms_permission_to_send Specifies if the contact gave <code>explicit</code> SMS permission or if the SMS permission was not set (<code>not_set</code>). If `explicit, the <code>sms_consent_date</code> must be provided.
*/
class ContactsJsonImport extends \PHPFUI\ConstantContact\Definition\Base
{
protected static array $fields = [
'import_data' => 'array<\PHPFUI\ConstantContact\Definition\JsonImportContact>',
'list_ids' => 'array<\PHPFUI\ConstantContact\UUID>',
'sms_permission_to_send' => 'string',

];

Expand Down
6 changes: 6 additions & 0 deletions src/ConstantContact/Definition/JsonImportContact.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
* @property string $other_zip The zip or postal code associated with the contact's other address.
* @property string $other_country The name of another country where the contact is located.
* @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.
* @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>.
* @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 .
*/
class JsonImportContact extends \PHPFUI\ConstantContact\Definition\Base
{
Expand Down Expand Up @@ -85,6 +87,8 @@ class JsonImportContact extends \PHPFUI\ConstantContact\Definition\Base
'other_zip' => 'string',
'other_country' => 'string',
'cf:custom_field_name' => 'string',
'sms_number' => 'string',
'sms_consent_date' => 'string',

];

Expand Down Expand Up @@ -124,6 +128,8 @@ class JsonImportContact extends \PHPFUI\ConstantContact\Definition\Base
'other_zip' => 50,
'other_country' => 50,
'cf:custom_field_name' => 255,
'sms_number' => 16,
'sms_consent_date' => 16,

];
}
4 changes: 3 additions & 1 deletion src/ConstantContact/Definition/PlanInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
namespace PHPFUI\ConstantContact\Definition;

/**
* @property string $plan_type The type of billing plan (<code>plan_type</code>) to associate with a client's Constant Contact account. The type of billing plan determines which Constant Contact product features that the client account can access. The billing plan type that you enter must already exist in your plan group or a 400 error message is returned. After changing the <code>plan_type</code> from <code>TRIAL</code> to any other billing plan type, you cannot change it back to <code>TRIAL</code>.
* @property string $plan_type Use this property to update the client account billing plan to a different billing plan. After changing the <code>plan_type</code> from <code>TRIAL</code> to any other billing plan type, you cannot change it back to <code>TRIAL</code>.
* <ul>
* <li><code>TRIAL</code>: A non-billable account with an expiration date that allows clients to try Constant Contact product features.</li>
* <li><code>GOLD</code>: A billable client account plan.</li>
* <li><code>SILVER</code>: A billable client account plan.</li>
* <li><code>BRONZE</code>: A billable client account plan.</li>
* </ul>
* @property int $plan_group_id Updates an existing client account billing plan group to a new billing plan group. If you don't know the `plan_group_id` to use, contact our API support team.
* @property int $billing_day_of_month This property is required if a client account is not set up to use single billing. You can choose to enter a specific day of the month or accept the default value, which is the day on which the <code>plan_type</code> value changes from a <code>TRIAL</code> plan to a different <code>plan_type</code>. For trial accounts, the value defaults to null. You can only change the <code>billing_day_of_month</code> when changing the <code>plan_type</code> value from <code>TRIAL</code> to a different <code>plan_type</code>, otherwise the value you enter is ignored.
*/
class PlanInfo extends \PHPFUI\ConstantContact\Definition\Base
{
protected static array $fields = [
'plan_type' => 'string',
'plan_group_id' => 'int',
'billing_day_of_month' => 'int',

];
Expand Down
19 changes: 19 additions & 0 deletions src/ConstantContact/V3/Account/Summary/PhysicalAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ public function get() : array
return $this->doGet([]);
}

/**
* POST the Physical Address for the Account
*
* Use this method to add the address where the account's organization
* physically resides. The physical address is required to send emails
* and displays on the footer of every email that is sent from the account.
* The country (<code>country_code</code>) where the account organization
* resides determines whether you use the <code>state_code</code> to specify
* United States (<code>US</code>) and Canada (<code>CA</code>) addresses,
* or use the <code>state_name</code> to specify all other countries.
*
* @param \PHPFUI\ConstantContact\Definition\AccountPhysicalAddress $body Include all `AccountPhysicalAddress` properties required for the specified `country_code` and then update only those properties that you want to change. Excluding a non-read only field from the request body removes it from the physical address.
*/
public function post(\PHPFUI\ConstantContact\Definition\AccountPhysicalAddress $body) : array
{

return $this->doPost(['body' => $body->getData(), ]);
}

/**
* PUT (update) the Physical Address for an Account
*
Expand Down
21 changes: 10 additions & 11 deletions src/ConstantContact/V3/Partner/Accounts/Plan.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ public function get(string $encoded_account_id) : array
* Use this PUT method to update the type of billing plan to assign to
* the Constant Contact client account. The type of billing plan determines
* which Constant Contact product features that the client account can
* access. The billing plan type (`plan_type`) that you enter must already
* exist in the plan group. Attempting to change to a plan that is currently
* not available within your partner plan group results in a 400 error
* response code.
* access. The billing plan that you specify in the request body (`plan_type`)
* must already exist in the plan group. Attempting to change to a plan
* that is currently not available within your partner plan group results
* in a 400 error response code.
*
* When you create a new client account, the `plan_type` defaults to `TRIAL`
* and the `billing_day_of_month` defaults to `null`. The `billing_day_of_month`
Expand All @@ -67,16 +67,15 @@ public function get(string $encoded_account_id) : array
* in the API guide.
*
* @param string $encoded_account_id Specify the client's unique `encoded_account_id`.
* @param \PHPFUI\ConstantContact\Definition\PlanInfo $body Update the billing plan (`plan_type`) for an existing Constant Contact client account. Options include:
- `TRIAL`: A non-billed account with an expiration date that allows clients to try Constant Contact product features.
* @param \PHPFUI\ConstantContact\Definition\PlanInfo $body `plan_type`: Updates the billing plan assigned to a client account to a different `plan_type`.
- `GOLD`: A billable plan that provides all available product features.
`plan_group_id`: To update an older `plan_type` to a current a `plan_type`, use the `plan_group_id` parameter to specify the older billing `plan_type` number.
- `SILVER`: A billable plan that provides all features available in the <code>BRONZE</code> plan, and adds some additional email campaign feature such as contact segmentation and social media advertisements.
- If the specified `plan_group_id` does not exist under the account's current plan group, the default partner plan group is used.
- If the specified `plan_group_id` exists but does not match the account's current plan group, an error is returned.
- If the `plan_group_id` parameter is not included in the request, the accounts current plan group is used.
- `BRONZE`: A billable plan that provides basic email and marketing tools.
If updating from a `TRIAL` plan (`plan_type`) to another type of billing plan, you have the option to update the day of month (`billing_day_of_month`) in which to bill the client account. Valid values include `1` through to and including `31`. Any additional billing plan properties and values that you include in the request body are ignored. If you are not on the latest billing plan, contact the Constant Contact Partner Team. However, older billing plans and `plan_type` enum values will continue to be supported.
`billing_day_of _month`: Updates the day of month in which to bill the client account. This property is required if a client account is not set up to use single billing.
*/
public function put(string $encoded_account_id, ?\PHPFUI\ConstantContact\Definition\PlanInfo $body = null) : array
{
Expand Down
Loading

0 comments on commit 3e20ba3

Please sign in to comment.