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
|
public function attachments(): array
|
||||||
{
|
{
|
||||||
return $this->mailing->attachments()->get()->map(function (ProjectMailingAttachment $attachment) {
|
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;
|
$attachment_path = $attachment->mailing->project->download_path."/".$attachment->path;
|
||||||
|
|
||||||
if (!File::exists($attachment_path)) {
|
if (!File::exists($attachment_path)) {
|
||||||
|
logger('Could not find attachment: ' . $attachment_path);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
logger('Attachment found: ' . $attachment_path);
|
||||||
|
|
||||||
|
$mime = 'application/pdf'; // default MIME type
|
||||||
|
$extension = pathinfo($attachment->path, PATHINFO_EXTENSION);
|
||||||
if ($extension === 'docx') {
|
if ($extension === 'docx') {
|
||||||
$mime = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
$mime = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue