61 lines
2.1 KiB
PHP
61 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace App\Support\Readiness;
|
|
|
|
use App\Models\Mailbox;
|
|
use App\Models\MailTemplate;
|
|
use App\Services\Secrets\SecretVault;
|
|
|
|
/**
|
|
* What has to be in place for the customer to actually find out any of this
|
|
* happened: a mail transport that leaves the server, an address to send
|
|
* from, and — for support — a way to answer and to hear back.
|
|
*/
|
|
final class DeliveryChecks
|
|
{
|
|
public const GROUP = 'delivery';
|
|
|
|
/** @return array<int, Check> */
|
|
public static function all(): array
|
|
{
|
|
return [
|
|
new Check(
|
|
key: 'delivery.mailer_not_log',
|
|
group: self::GROUP,
|
|
severity: Check::SEVERITY_BLOCKING,
|
|
label: __('readiness.delivery.mailer_not_log'),
|
|
breaks: __('readiness.delivery.mailer_not_log_breaks'),
|
|
tab: 'mail',
|
|
satisfied: config('mail.default') !== 'log',
|
|
),
|
|
new Check(
|
|
key: 'delivery.mailbox',
|
|
group: self::GROUP,
|
|
severity: Check::SEVERITY_BLOCKING,
|
|
label: __('readiness.delivery.mailbox'),
|
|
breaks: __('readiness.delivery.mailbox_breaks'),
|
|
tab: 'mail',
|
|
satisfied: Mailbox::query()->exists(),
|
|
),
|
|
new Check(
|
|
key: 'delivery.mail_templates',
|
|
group: self::GROUP,
|
|
severity: Check::SEVERITY_WARNING,
|
|
label: __('readiness.delivery.mail_templates'),
|
|
breaks: __('readiness.delivery.mail_templates_breaks'),
|
|
tab: 'templates',
|
|
satisfied: MailTemplate::query()->exists(),
|
|
),
|
|
new Check(
|
|
key: 'delivery.inbound_password',
|
|
group: self::GROUP,
|
|
severity: Check::SEVERITY_WARNING,
|
|
label: __('readiness.delivery.inbound_password'),
|
|
breaks: __('readiness.delivery.inbound_password_breaks'),
|
|
tab: 'integrations',
|
|
satisfied: filled(app(SecretVault::class)->get('inbound_mail.password')),
|
|
),
|
|
];
|
|
}
|
|
}
|