48 lines
937 B
PHP
48 lines
937 B
PHP
<?php
|
|
|
|
namespace KupShop\MessengerBundle\Message;
|
|
|
|
use KupShop\KupShopBundle\Email\BaseEmail;
|
|
|
|
class EmailMessage
|
|
{
|
|
private $message;
|
|
private $prioritized;
|
|
private $service;
|
|
private string $id;
|
|
|
|
/**
|
|
* EmailMessage constructor.
|
|
*
|
|
* @param $service BaseEmail
|
|
*/
|
|
public function __construct(array $message, BaseEmail $service, bool $prioritized = false)
|
|
{
|
|
$this->id = uniqid();
|
|
$message['id'] = $this->id;
|
|
$this->message = $message;
|
|
$this->prioritized = $prioritized;
|
|
$this->service = $service;
|
|
}
|
|
|
|
public function getMessage()
|
|
{
|
|
return $this->message;
|
|
}
|
|
|
|
public function getEmailService(): BaseEmail
|
|
{
|
|
return $this->service;
|
|
}
|
|
|
|
public function isPrioritized()
|
|
{
|
|
return (bool) $this->prioritized;
|
|
}
|
|
|
|
public function getId(): string
|
|
{
|
|
return $this->id ?? 'not yet';
|
|
}
|
|
}
|