added logging to attachment
This commit is contained in:
parent
3ea7eec68e
commit
58d5ce47a1
|
|
@ -65,14 +65,16 @@ public function content(): Content
|
|||
public function attachments(): array
|
||||
{
|
||||
return $this->mailing->attachments()->get()->map(function (ProjectMailingAttachment $attachment) {
|
||||
$mime = 'application/pdf'; // default MIME type
|
||||
$extension = pathinfo($attachment->path, PATHINFO_EXTENSION);
|
||||
$attachment_path = $attachment->mailing->project->download_path."/".$attachment->path;
|
||||
|
||||
if (!File::exists($attachment_path)) {
|
||||
logger('Could not find attachment: ' . $attachment_path);
|
||||
return null;
|
||||
}
|
||||
logger('Attachment found: ' . $attachment_path);
|
||||
|
||||
$mime = 'application/pdf'; // default MIME type
|
||||
$extension = pathinfo($attachment->path, PATHINFO_EXTENSION);
|
||||
if ($extension === 'docx') {
|
||||
$mime = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue