post->workspace->name}", ); } public function content(): Content { $failedPlatforms = $this->post->postPlatforms() ->with('socialAccount') ->where('enabled', true) ->get() ->filter(fn ($pp) => $pp->status === Status::Failed) ->map(fn ($pp) => [ 'name' => $pp->platform->label().' (@'.data_get($pp, 'socialAccount.username', data_get($pp, 'socialAccount.display_name', '')).')', 'error' => $pp->error_message, ]) ->values() ->all(); return new Content( view: 'mail.post-publish-failed', with: [ 'title' => 'Your post failed to publish', 'previewText' => 'One or more platforms failed to publish your post.', 'body' => "Your scheduled post in the {$this->post->workspace->name} workspace failed to publish on one or more platforms.", 'failedPlatforms' => $failedPlatforms, 'url' => route('app.posts.edit', $this->post), ], ); } public function attachments(): array { return []; } }