| @@ 322-335 (lines=14) @@ | ||
| 319 | /** |
|
| 320 | * @throws LimitExceeded |
|
| 321 | */ |
|
| 322 | public function addCampaignId(string $campaignId): self |
|
| 323 | { |
|
| 324 | if ($this->counters['attributes']['campaign_id'] >= self::CAMPAIGN_ID_LIMIT) { |
|
| 325 | throw LimitExceeded::create('campaigns', self::CAMPAIGN_ID_LIMIT); |
|
| 326 | } |
|
| 327 | if (isset($this->message['o:campaign'])) { |
|
| 328 | array_push($this->message['o:campaign'], (string) $campaignId); |
|
| 329 | } else { |
|
| 330 | $this->message['o:campaign'] = [(string) $campaignId]; |
|
| 331 | } |
|
| 332 | ++$this->counters['attributes']['campaign_id']; |
|
| 333 | ||
| 334 | return $this; |
|
| 335 | } |
|
| 336 | ||
| 337 | /** |
|
| 338 | * @throws LimitExceeded |
|
| @@ 340-354 (lines=15) @@ | ||
| 337 | /** |
|
| 338 | * @throws LimitExceeded |
|
| 339 | */ |
|
| 340 | public function addTag(string $tag): self |
|
| 341 | { |
|
| 342 | if ($this->counters['attributes']['tag'] >= self::TAG_LIMIT) { |
|
| 343 | throw LimitExceeded::create('tags', self::TAG_LIMIT); |
|
| 344 | } |
|
| 345 | ||
| 346 | if (isset($this->message['o:tag'])) { |
|
| 347 | array_push($this->message['o:tag'], $tag); |
|
| 348 | } else { |
|
| 349 | $this->message['o:tag'] = [$tag]; |
|
| 350 | } |
|
| 351 | ++$this->counters['attributes']['tag']; |
|
| 352 | ||
| 353 | return $this; |
|
| 354 | } |
|
| 355 | ||
| 356 | public function setDkim(bool $enabled): self |
|
| 357 | { |
|