Customised email reply to (#186)

Co-authored-by: Julien Nahum <julien@nahum.net>
This commit is contained in:
formsdev
2023-09-06 13:34:08 +05:30
committed by GitHub
parent c66c09e17b
commit a06a43c01c
6 changed files with 54 additions and 25 deletions

View File

@@ -9,6 +9,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Str;
use Illuminate\Support\Arr;
class FormSubmissionNotification extends Notification implements ShouldQueue
{
@@ -68,6 +69,10 @@ class FormSubmissionNotification extends Notification implements ShouldQueue
private function getReplyToEmail($default)
{
$replyTo = Arr::get((array)$this->event->form->notification_settings, 'notification_reply_to', null);
if ($replyTo && $this->validateEmail($replyTo)) {
return $replyTo;
}
return $this->getRespondentEmail() ?? $default;
}