You are here

function campaignmonitor_set_extended_list_settings in Campaign Monitor 8

Helper function to set the remote options for a list.

Parameters

$list_id:

$options:

Return value

bool

1 call to campaignmonitor_set_extended_list_settings()
CampaignMonitorListSettingsForm::validateForm in src/Form/CampaignMonitorListSettingsForm.php
Edit form validation handler which calls the API to save the information that was entered. This is done in the validation function so we can give better feedback to the user and to prevent the user from having to enter the information once more on…

File

./campaignmonitor.module, line 216
Module that plugs in Campaign Monitor functionality to your Drupal web site. For Campaign Monitor information see: http://www.campaignmonitor.com/.

Code

function campaignmonitor_set_extended_list_settings($list_id, $options) {
  $cm = CampaignMonitor::getConnector();

  // Update the information.
  if (!$cm
    ->updateList($list_id, $options)) {
    $error = $cm
      ->getLatestError();
    drupal_set_message(t('The list options were not updated correctly at Campaign Monitor.'), 'error');
    return $error['message'];
  }
  return 'success';
}