. */ namespace App\Mail; class NewComment extends BaseNotification { /** * {@inheritdoc} */ public function build() { $creatorName = $this->initiatingUser->display_name; // Profile comments get a different template and subject line from // other types of comments. if ($this->activityRecord->isProfileComment()) { return $this->renderEmail( 'new-comment-profile', $this->activityRecord->text, [ 'creatorName' => $creatorName, 'comment' => $this->activityRecord->resource->content, ]); } else { return $this->renderEmail( 'new-comment-content', $this->activityRecord->text, [ 'creatorName' => $creatorName, 'resourceType' => $this->activityRecord->getResourceTypeString(), 'resourceTitle' => $this->activityRecord->resource->resource->title, 'comment' => $this->activityRecord->resource->content, ]); } } }