<?phpnamespace App\Model\Email\Webhook;use App\Enum\EmailMessageStatusEnum;use DateTime;use DateTimeInterface;use Symfony\Component\Serializer\Annotation\SerializedName;/** * * @see https://developers.brevo.com/docs/getting-started * @see https://developers.brevo.com/docs/transactional-webhooks * @see https://developers.brevo.com/docs/send-a-transactional-email * @see https://developers.brevo.com/docs/send-a-transactional-email#tracking-your-transactional-activity-through-webhooks * @see https://developers.brevo.com/reference/sendtransacemail */class Webhook{ private string $event; // type of event (status synonym) from EmailMessageStatusEnum /** * @SerializedName("id") */ private string $webhookId; // webhook id at the third party mail provider (Brevo e.g.) private string $email; // TO (the recipient of the email) /** * @SerializedName("ts") */ private string $timestamp; /** * @SerializedName("message-id") */ private string $messageId; // message-id at the third party mail provider (Brevo e.g.) private string $subject; private ?string $link = null; // URL accessed by recipient private ?string $deviceUsed = null; // Details about the device from which the action originated (DESKTOP, MOBILE, ...) private ?string $reason = null; // The reason the message has been deferred, soft_bounced or hard_bounce public function __construct() { } public function getEvent(): string { return $this->event; } public function setEvent(string $event): self { $this->event = $event; return $this; } public function getWebhookId(): string { return $this->webhookId; } public function setWebhookId(string $webhookId): self { $this->webhookId = $webhookId; return $this; } public function getEmail(): string { return $this->email; } public function setEmail(string $email): self { $this->email = $email; return $this; } public function getTimestamp(): string { return $this->timestamp; } public function setTimestamp(string $timestamp): self { $this->timestamp = $timestamp; return $this; } public function getEventDatetime(): DateTimeInterface { $datetime = new DateTime(); return $datetime->setTimestamp($this->timestamp); } public function getMessageId(): string { return $this->messageId; } public function setMessageId(string $messageId): self { $this->messageId = $messageId; return $this; } public function getSubject(): string { return $this->subject; } public function setSubject(string $subject): self { $this->subject = $subject; return $this; } public function getLink(): ?string { return $this->link; } public function setLink(?string $link): self { $this->link = $link; return $this; } public function getDeviceUsed(): ?string { return $this->deviceUsed; } public function setDeviceUsed(?string $deviceUsed): self { $this->deviceUsed = $deviceUsed; return $this; } public function getReason(): ?string { return $this->reason; } public function setReason(?string $reason): self { $this->reason = $reason; return $this; }}