You are here

protected function CampaignMonitorCampaignSendForm::createDataPacket in Campaign Monitor 8

Create the packet to send to Campaign Monitor.

Parameters

array $settings:

object $node:

string $filepath:

1 call to CampaignMonitorCampaignSendForm::createDataPacket()
CampaignMonitorCampaignSendForm::submitForm in modules/campaignmonitor_campaign/src/Form/CampaignMonitorCampaignSendForm.php
Form submission handler.

File

modules/campaignmonitor_campaign/src/Form/CampaignMonitorCampaignSendForm.php, line 177

Class

CampaignMonitorCampaignSendForm
Campaign Monitor send form.

Namespace

Drupal\campaignmonitor_campaign\Form

Code

protected function createDataPacket($settings, $node, $filepath) {
  $author = $node
    ->getOwner();
  $account = User::load($author
    ->id());
  return [
    'Subject' => $node
      ->getTitle(),
    'Name' => $node
      ->getTitle(),
    'FromName' => $account
      ->getDisplayName(),
    'FromEmail' => $account
      ->getEmail(),
    'ReplyTo' => $account
      ->getEmail(),
    'HtmlUrl' => $filepath,
    // 'TextUrl' => 'Optional campaign text import URL',.
    'ListIDs' => $settings['lists'],
  ];
}