event->form; $formatter = (new FormSubmissionFormatter($form, $this->event->data)) ->createLinks() ->outputStringsOnly() ->useSignedUrlForFiles(); return $this ->replyTo($this->getReplyToEmail($form->creator->email)) ->from($this->getFromEmail(), $form->notification_sender) ->subject($form->notification_subject) ->markdown('mail.form.confirmation-submission-notification', [ 'fields' => $formatter->getFieldsWithValue(), 'form' => $form, 'noBranding' => $form->no_branding, 'submission_id' => (isset($this->event->data['submission_id']) && $this->event->data['submission_id']) ? Hashids::encode($this->event->data['submission_id']) : null, ]); } private function getFromEmail() { $originalFromAddress = Str::of(config('mail.from.address'))->explode('@'); return $originalFromAddress->first().'+'.time().'@'.$originalFromAddress->last(); } private function getReplyToEmail($default) { $replyTo = Arr::get((array) $this->event->form->notification_settings, 'confirmation_reply_to', null); return $replyTo ?? $default; } }