Skip to content

Beautiful Open-Source Form Builder

fix email from address in self hosted mode (#573)

Favour Olayinka7f6c21408c61
diff --git a/api/app/Mail/Forms/SubmissionConfirmationMail.php b/api/app/Mail/Forms/SubmissionConfirmationMail.php
index 9cca8313f..de9dd86e7 100644
--- a/api/app/Mail/Forms/SubmissionConfirmationMail.php
+++ b/api/app/Mail/Forms/SubmissionConfirmationMail.php
@@ -54,6 +54,10 @@ class SubmissionConfirmationMail extends OpenFormMail implements ShouldQueue
private function getFromEmail()
{
+ if(config('app.self_hosted')) {
+ return config('mail.from.address');
+ }
+
$originalFromAddress = Str::of(config('mail.from.address'))->explode('@');
return $originalFromAddress->first() . '+' . time() . '@' . $originalFromAddress->last();
diff --git a/api/app/Notifications/Forms/FormSubmissionNotification.php b/api/app/Notifications/Forms/FormSubmissionNotification.php
index 0fc2742a3..4ff69836f 100644
--- a/api/app/Notifications/Forms/FormSubmissionNotification.php
+++ b/api/app/Notifications/Forms/FormSubmissionNotification.php
@@ -63,6 +63,9 @@ class FormSubmissionNotification extends Notification implements ShouldQueue
private function getFromEmail()
{
+ if(config('app.self_hosted')) {
+ return config('mail.from.address');
+ }
$originalFromAddress = Str::of(config('mail.from.address'))->explode('@');
return $originalFromAddress->first() . '+' . time() . '@' . $originalFromAddress->last();