| Total Complexity | 4 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class CandidateMailable extends Mailable |
||
| 10 | { |
||
| 11 | use Queueable; |
||
| 12 | |||
| 13 | /** |
||
| 14 | * @var Message |
||
| 15 | */ |
||
| 16 | private $messageToSend; //the name cannot be just $message bacause it interferes with sth |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Using in event listener. |
||
| 20 | * |
||
| 21 | * @var int |
||
| 22 | */ |
||
| 23 | public $messageId; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * We need Tenant to use in MessageSentListener. |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | public $tenantIdentifier; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Create a new message instance. |
||
| 34 | * |
||
| 35 | * @param Message $messageToSend |
||
| 36 | */ |
||
| 37 | public function __construct(Message $messageToSend) |
||
| 38 | { |
||
| 39 | $this->messageToSend = $messageToSend; |
||
| 40 | $this->messageId = $messageToSend->id; |
||
| 41 | |||
| 42 | $tenantManager = resolve('App\Services\TenantManager'); |
||
| 43 | $this->tenantIdentifier = $tenantManager->getTenant()->subdomain; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Build the message. |
||
| 48 | * |
||
| 49 | * @return $this |
||
| 50 | */ |
||
| 51 | public function build() |
||
| 62 | } |
||
| 63 | } |
||
| 64 |