-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8d9d631
Showing
12 changed files
with
666 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace t3n\MailJetAdapter\Exception; | ||
|
||
use Neos\Flow\Exception; | ||
|
||
class MailJetInvalidContactDataException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace t3n\MailJetAdapter\Exception; | ||
|
||
use Neos\Flow\Exception; | ||
|
||
class MailJetRequestException extends Exception | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace t3n\MailJetAdapter\Factory; | ||
|
||
use Mailjet\Client; | ||
use Neos\Flow\Annotations as Flow; | ||
|
||
/** | ||
* @Flow\Scope("singleton") | ||
*/ | ||
class MailJetFactory | ||
{ | ||
/** | ||
* @Flow\InjectConfiguration(path="mailjet.clientConfiguration") | ||
* | ||
* @var string[] | ||
*/ | ||
protected $clientConfiguration; | ||
|
||
/** | ||
* @var Client|null | ||
*/ | ||
protected $client = null; | ||
|
||
public function createClient(): Client | ||
{ | ||
if ($this->client !== null) { | ||
return $this->client; | ||
} | ||
|
||
$client = new Client($this->clientConfiguration['apiKey'], $this->clientConfiguration['apiSecret'], (bool) $this->clientConfiguration['liveMode'], ['version' => $this->clientConfiguration['apiVersion']]); | ||
$this->client = $client; | ||
|
||
return $client; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,193 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace t3n\MailJetAdapter\Model; | ||
|
||
use Doctrine\Common\Collections\ArrayCollection; | ||
use t3n\MailJetAdapter\ValueObject\MailJetContactEmail; | ||
use t3n\MailJetAdapter\ValueObject\MailJetContactIdentifier; | ||
|
||
class Contact | ||
{ | ||
/** | ||
* @var MailJetContactIdentifier | ||
*/ | ||
protected $identifier; | ||
|
||
/** | ||
* @var MailJetContactEmail | ||
*/ | ||
protected $email; | ||
|
||
/** | ||
* @var \DateTime | ||
*/ | ||
protected $createdAt; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
protected $name; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
protected $deliveredCount; | ||
|
||
/** | ||
* @var bool; | ||
*/ | ||
protected $isOptInPending; | ||
|
||
/** | ||
* @var \DateTime|null | ||
*/ | ||
protected $lastActivityAt; | ||
|
||
/** | ||
* @var \DateTime|null | ||
*/ | ||
protected $lastUpdateAt; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
protected $isSpamComplaining; | ||
|
||
/** | ||
* @var \DateTime|null | ||
*/ | ||
protected $exclusionFromCampaignsUpdatedAt; | ||
|
||
/** | ||
* @var bool | ||
*/ | ||
protected $isExcludedFromCampaigns; | ||
|
||
/** | ||
* @var ArrayCollection<ContactData> | ||
*/ | ||
protected $contactData; | ||
|
||
public function __construct(MailJetContactIdentifier $identifier) | ||
{ | ||
$this->identifier = $identifier; | ||
$this->contactData = new ArrayCollection(); | ||
} | ||
|
||
public function getIdentifier(): MailJetContactIdentifier | ||
{ | ||
return $this->identifier; | ||
} | ||
|
||
public function getEmail(): MailJetContactEmail | ||
{ | ||
return $this->email; | ||
} | ||
|
||
public function setEmail(MailJetContactEmail $email): void | ||
{ | ||
$this->email = $email; | ||
} | ||
|
||
public function getCreatedAt(): \DateTime | ||
{ | ||
return $this->createdAt; | ||
} | ||
|
||
public function setCreatedAt(\DateTime $createdAt): void | ||
{ | ||
$this->createdAt = $createdAt; | ||
} | ||
|
||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function setName(string $name): void | ||
{ | ||
$this->name = $name; | ||
} | ||
|
||
public function getDeliveredCount(): int | ||
{ | ||
return $this->deliveredCount; | ||
} | ||
|
||
public function setDeliveredCount(int $deliveredCount): void | ||
{ | ||
$this->deliveredCount = $deliveredCount; | ||
} | ||
|
||
public function isOptInPending(): bool | ||
{ | ||
return $this->isOptInPending; | ||
} | ||
|
||
public function setIsOptInPending(bool $isOptInPending): void | ||
{ | ||
$this->isOptInPending = $isOptInPending; | ||
} | ||
|
||
public function getLastActivityAt(): ?\DateTime | ||
{ | ||
return $this->lastActivityAt; | ||
} | ||
|
||
public function setLastActivityAt(?\DateTime $lastActivityAt): void | ||
{ | ||
$this->lastActivityAt = $lastActivityAt; | ||
} | ||
|
||
public function getLastUpdateAt(): ?\DateTime | ||
{ | ||
return $this->lastUpdateAt; | ||
} | ||
|
||
public function setLastUpdateAt(?\DateTime $lastUpdateAt): void | ||
{ | ||
$this->lastUpdateAt = $lastUpdateAt; | ||
} | ||
|
||
public function isSpamComplaining(): bool | ||
{ | ||
return $this->isSpamComplaining; | ||
} | ||
|
||
public function setIsSpamComplaining(bool $isSpamComplaining): void | ||
{ | ||
$this->isSpamComplaining = $isSpamComplaining; | ||
} | ||
|
||
public function getExclusionFromCampaignsUpdatedAt(): ?\DateTime | ||
{ | ||
return $this->exclusionFromCampaignsUpdatedAt; | ||
} | ||
|
||
public function setExclusionFromCampaignsUpdatedAt(?\DateTime $exclusionFromCampaignsUpdatedAt): void | ||
{ | ||
$this->exclusionFromCampaignsUpdatedAt = $exclusionFromCampaignsUpdatedAt; | ||
} | ||
|
||
public function isExcludedFromCampaigns(): bool | ||
{ | ||
return $this->isExcludedFromCampaigns; | ||
} | ||
|
||
public function setIsExcludedFromCampaigns(bool $isExcludedFromCampaigns): void | ||
{ | ||
$this->isExcludedFromCampaigns = $isExcludedFromCampaigns; | ||
} | ||
|
||
public function getContactData(): ArrayCollection | ||
{ | ||
return $this->contactData; | ||
} | ||
|
||
public function setContactData(ArrayCollection $contactData): void | ||
{ | ||
$this->contactData = $contactData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace t3n\MailJetAdapter\Model; | ||
|
||
class ContactData | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $name; | ||
|
||
/** | ||
* @var mixed | ||
*/ | ||
protected $value; | ||
|
||
public function getName(): string | ||
{ | ||
return $this->name; | ||
} | ||
|
||
public function setName(string $name): void | ||
{ | ||
$this->name = $name; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function getValue() | ||
{ | ||
return $this->value; | ||
} | ||
|
||
/** | ||
* @param mixed $value | ||
*/ | ||
public function setValue($value): void | ||
{ | ||
$this->value = $value; | ||
} | ||
} |
Oops, something went wrong.