data = $data; } /** * Build the message. * * @return $this */ abstract public function build(); /** * Attach a joined file if given in data * * @return void */ protected function joinFileIfProvided(): void { if (isset($this->data['file'])) { $joinedFileName = sprintf( 'PortEmployee-PJ-%s.%s', date("YmdHis"), $this->data['file']->extension() ); $this->attach($this->data['file'], [ 'as' => $joinedFileName, 'mime' => $this->data['file']->getMimeType() ]); } } }