Sunnysideup\CampaignMonitor\Api\Traits\Subscribers::updateSubscriber
Updates an existing subscriber (email, name, state, or custom fields) in the specified list.
The update is performed even for inactive subscribers, but will return an error in the event of the given email not existing in the list.
Signature
public function updateSubscriber(string
$listID,
Member
$member,
[string
$oldEmailAddress = '',
[array
$customFields = ,
[boolean
$resubscribe = true,
[boolean
$restartSubscriptionBasedAutoResponders = false]]]] )
Parameters
$listID
— string$member
— object- (Member or standard object with Email, FirstName, Surname properties)
$oldEmailAddress
— string
$customFields
— array- the subscriber details to use during creation
$resubscribe
— boolean- Whether we should resubscribe this subscriber if they already exist in the list
$restartSubscriptionBasedAutoResponders
— boolean- Whether we should restart subscription based auto responders which are sent when the subscriber first subscribes to a list.
NOTE that for the custom fields they need to be formatted like this:
Array(
'Key' => The custom fields personalisation tag
'Value' => The value for this subscriber
'Clear' => true/false (pass true to remove this custom field. in the case of a [multi-option, select many] field, pass an option in the 'Value' field to clear that option or leave Value blank to remove all options)
)
Returns
- mixed
- An unsuccessful response will be empty! A good result with contains something / be true