Skip to content

Commit a307efc

Browse files
authored
Merge pull request #62 from sendpulse/api-ft-24105-add_support_segment_id
add support segment_id
2 parents d1d7c4e + 1dc1fce commit a307efc

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

src/ApiClient.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -555,17 +555,17 @@ public function campaignStatByReferrals($id)
555555
/**
556556
* Create new campaign
557557
*
558-
* @param $senderName
559-
* @param $senderEmail
560-
* @param $subject
561-
* @param $bodyOrTemplateId
562-
* @param $bookId
558+
* @param $senderName
559+
* @param $senderEmail
560+
* @param $subject
561+
* @param $bodyOrTemplateId
562+
* @param $bookId
563563
* @param string $name
564564
* @param string $attachments
565565
* @param string $type
566566
* @param bool $useTemplateId
567567
* @param string $sendDate
568-
*
568+
* @param int|null $segmentId
569569
* @return mixed
570570
*/
571571
public function createCampaign(
@@ -578,7 +578,8 @@ public function createCampaign(
578578
$attachments = '',
579579
$type = '',
580580
$useTemplateId = false,
581-
$sendDate = ''
581+
$sendDate = '',
582+
$segmentId = null
582583
)
583584
{
584585
if (empty($senderName) || empty($senderEmail) || empty($subject) || empty($bodyOrTemplateId) || empty($bookId)) {
@@ -608,10 +609,14 @@ public function createCampaign(
608609
'type' => $type,
609610
);
610611

611-
if(!empty($sendDate)){
612+
if (!empty($sendDate)) {
612613
$data['send_date'] = $sendDate;
613614
}
614615

616+
if (!empty($segmentId)) {
617+
$data['segment_id'] = $segmentId;
618+
}
619+
615620
$requestResult = $this->sendRequest('campaigns', 'POST', $data);
616621

617622
return $this->handleResult($requestResult);

0 commit comments

Comments
 (0)