Merge pull request #1289 from coollabsio/next

v4.0.0-beta.68
This commit is contained in:
Andras Bacsai 2023-10-06 10:58:12 +02:00 committed by GitHub
commit 26048339d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 59 additions and 12 deletions

View File

@ -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');

View File

@ -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'),

View File

@ -1,3 +1,3 @@
<?php
return '4.0.0-beta.67';
return '4.0.0-beta.68';

View File

@ -0,0 +1,28 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('teams', function (Blueprint $table) {
$table->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();
});
}
};

View File

@ -22,7 +22,8 @@
</x-forms.button>
@endif
@if (isEmailEnabled($team) &&
auth()->user()->isAdminFromSession())
auth()->user()->isAdminFromSession() &&
isTestEmailEnabled($team))
<x-forms.button onclick="sendTestEmail.showModal()"
class="text-white normal-case btn btn-xs no-animation btn-primary">
Send Test Email
@ -31,15 +32,22 @@
</div>
</form>
@if ($this->sharedEmailEnabled)
<div class="w-64 pb-4">
<x-forms.checkbox instantSave="instantSaveInstance" id="team.use_instance_email_settings"
label="Use hosted email service" />
</div>
@if (isCloud())
@if ($this->sharedEmailEnabled)
<div class="w-64 pb-4">
<x-forms.checkbox instantSave="instantSaveInstance" id="team.use_instance_email_settings"
label="Use Hosted Email Service" />
</div>
@else
<div class="pb-4 w-96">
<x-forms.checkbox disabled id="team.use_instance_email_settings"
label="Use Hosted Email Service (Pro+ subscription required)" />
</div>
@endif
@else
<div class="pb-4 w-96">
<x-forms.checkbox disabled id="team.use_instance_email_settings"
label="Use hosted email service (Pro+ subscription required)" />
<x-forms.checkbox instantSave="instantSaveInstance" id="team.use_instance_email_settings"
label="Use system wide (transactional) email settings" />
</div>
@endif
@if (!$team->use_instance_email_settings)

View File

@ -22,7 +22,9 @@
<x-forms.button type="submit">
Save
</x-forms.button>
@if (isEmailEnabled($settings))
@if (isEmailEnabled($settings) &&
auth()->user()->isAdminFromSession() &&
isTestEmailEnabled($settings))
<x-forms.button onclick="sendTestEmail.showModal()"
class="text-white normal-case btn btn-xs no-animation btn-primary">
Send Test Email

View File

@ -4,7 +4,7 @@
"version": "3.12.36"
},
"v4": {
"version": "4.0.0-beta.67"
"version": "4.0.0-beta.68"
}
}
}