send( $ownerPublicId, $to, 'Programme for '.$eventName, 'mail.notifications.event-programme', compact('eventName', 'programmeUrl', 'attendeeName'), ); } public function sendJoinLink( string $ownerPublicId, string $to, string $eventName, string $joinUrl, ?string $attendeeName = null, ): bool { return $this->send( $ownerPublicId, $to, 'Join '.$eventName, 'mail.notifications.event-join', compact('eventName', 'joinUrl', 'attendeeName'), ); } public function sendJoinAndProgramme( string $ownerPublicId, string $to, string $eventName, string $joinUrl, string $programmeUrl, ?string $attendeeName = null, ): bool { return $this->send( $ownerPublicId, $to, $eventName.' — programme & join link', 'mail.notifications.event-join-programme', compact('eventName', 'joinUrl', 'programmeUrl', 'attendeeName'), ); } public function sendRegistrationConfirmation( string $ownerPublicId, string $to, string $eventName, string $badgeCode, ?string $joinUrl = null, ?string $attendeeName = null, ): bool { return $this->send( $ownerPublicId, $to, 'Registration confirmed — '.$eventName, 'mail.notifications.event-registration-confirmed', compact('eventName', 'badgeCode', 'joinUrl', 'attendeeName'), ); } public function sendSpeakerInvite( string $ownerPublicId, string $to, string $eventName, string $portalUrl, ?string $speakerName = null, ): bool { return $this->send( $ownerPublicId, $to, 'Speaker invitation — '.$eventName, 'mail.notifications.event-speaker-invite', [ 'eventName' => $eventName, 'portalUrl' => $portalUrl, 'speakerName' => $speakerName, ], ); } /** @param array $viewData */ private function send(string $ownerPublicId, string $to, string $subject, string $view, array $viewData): bool { $html = View::make($view, $viewData)->render(); return $this->platform->send( $ownerPublicId, $to, $subject, $html, strip_tags(str_replace(['
', '
', '
'], "\n", $html)), ); } }