diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index ee1e4fe2b..a12d6b02d 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -343,6 +343,15 @@ function send_user_an_email(MailMessage $mail, string $email, ?string $cc = null ); } } +function isTestEmailEnabled($notifiable) +{ + if (data_get($notifiable, 'use_instance_email_settings') && isInstanceAdmin()) { + return true; + } else if (data_get($notifiable, 'smtp_enabled') || data_get($notifiable, 'resend_enabled') && auth()->user()->isAdminFromSession()) { + return true; + } + return false; +} function isEmailEnabled($notifiable) { return data_get($notifiable, 'smtp_enabled') || data_get($notifiable, 'resend_enabled') || data_get($notifiable, 'use_instance_email_settings'); diff --git a/config/sentry.php b/config/sentry.php index 39f09d436..25eda3bcb 100644 --- a/config/sentry.php +++ b/config/sentry.php @@ -7,7 +7,7 @@ return [ // The release version of your application // Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')) - 'release' => '4.0.0-beta.67', + 'release' => '4.0.0-beta.68', // When left empty or `null` the Laravel environment will be used 'environment' => config('app.env'), diff --git a/config/version.php b/config/version.php index d39ecf0c6..9877f77ef 100644 --- a/config/version.php +++ b/config/version.php @@ -1,3 +1,3 @@ boolean('use_instance_email_settings')->default(true)->change(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('teams', function (Blueprint $table) { + $table->boolean('use_instance_email_settings')->default(false)->change(); + }); + } +}; diff --git a/resources/views/livewire/notifications/email-settings.blade.php b/resources/views/livewire/notifications/email-settings.blade.php index 8734b3c60..fb38247b4 100644 --- a/resources/views/livewire/notifications/email-settings.blade.php +++ b/resources/views/livewire/notifications/email-settings.blade.php @@ -22,7 +22,8 @@ @endif @if (isEmailEnabled($team) && - auth()->user()->isAdminFromSession()) + auth()->user()->isAdminFromSession() && + isTestEmailEnabled($team)) Send Test Email @@ -31,15 +32,22 @@ - @if ($this->sharedEmailEnabled) -
- -
+ @if (isCloud()) + @if ($this->sharedEmailEnabled) +
+ +
+ @else +
+ +
+ @endif @else
- +
@endif @if (!$team->use_instance_email_settings) diff --git a/resources/views/livewire/settings/email.blade.php b/resources/views/livewire/settings/email.blade.php index 09fa6097c..3758ca373 100644 --- a/resources/views/livewire/settings/email.blade.php +++ b/resources/views/livewire/settings/email.blade.php @@ -22,7 +22,9 @@ Save - @if (isEmailEnabled($settings)) + @if (isEmailEnabled($settings) && + auth()->user()->isAdminFromSession() && + isTestEmailEnabled($settings)) Send Test Email diff --git a/versions.json b/versions.json index d3590f35c..e8c451510 100644 --- a/versions.json +++ b/versions.json @@ -4,7 +4,7 @@ "version": "3.12.36" }, "v4": { - "version": "4.0.0-beta.67" + "version": "4.0.0-beta.68" } } }