Fix Laravel Pint formatting
This commit is contained in:
@@ -11,6 +11,7 @@ class BroadcastEmailComposerService
|
||||
$html = preg_replace('#<(script|iframe)[^>]*>.*?</\\1>#is', '', $html);
|
||||
$html = preg_replace('/\\son\\w+="[^"]*"/i', '', $html);
|
||||
$html = preg_replace("/\\son\\w+='[^']*'/i", '', $html);
|
||||
|
||||
return $html ?? '';
|
||||
}
|
||||
|
||||
@@ -26,7 +27,7 @@ class BroadcastEmailComposerService
|
||||
): string {
|
||||
$content = $personalize ? str_replace('{{name}}', $recipientName, $body) : $body;
|
||||
|
||||
if (!$wrapLayout) {
|
||||
if (! $wrapLayout) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Services\EmailService;
|
||||
class BroadcastEmailDispatchService
|
||||
{
|
||||
private EmailService $mailer;
|
||||
|
||||
private BroadcastEmailComposerService $composer;
|
||||
|
||||
public function __construct(EmailService $mailer, BroadcastEmailComposerService $composer)
|
||||
@@ -30,7 +31,7 @@ class BroadcastEmailDispatchService
|
||||
|
||||
$ok = $this->mailer->send(
|
||||
$payload['test_email'],
|
||||
'[TEST] ' . $payload['subject'],
|
||||
'[TEST] '.$payload['subject'],
|
||||
$html,
|
||||
$payload['from_key']
|
||||
);
|
||||
|
||||
@@ -26,7 +26,7 @@ class BroadcastEmailImageService
|
||||
}
|
||||
|
||||
$mime = strtolower((string) $file->getMimeType());
|
||||
if (!isset($this->allowedTypes[$mime])) {
|
||||
if (! isset($this->allowedTypes[$mime])) {
|
||||
return [
|
||||
'ok' => false,
|
||||
'status' => 415,
|
||||
@@ -43,17 +43,17 @@ class BroadcastEmailImageService
|
||||
}
|
||||
|
||||
$targetDir = public_path('uploads/email');
|
||||
if (!is_dir($targetDir)) {
|
||||
if (! is_dir($targetDir)) {
|
||||
@mkdir($targetDir, 0755, true);
|
||||
}
|
||||
|
||||
$ext = $this->allowedTypes[$mime];
|
||||
$newName = 'em_' . bin2hex(random_bytes(16)) . '.' . $ext;
|
||||
$newName = 'em_'.bin2hex(random_bytes(16)).'.'.$ext;
|
||||
$file->move($targetDir, $newName);
|
||||
|
||||
return [
|
||||
'ok' => true,
|
||||
'url' => asset('uploads/email/' . $newName),
|
||||
'url' => asset('uploads/email/'.$newName),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ class BroadcastEmailRecipientService
|
||||
|
||||
return array_values(array_filter($parents, static function ($parent) {
|
||||
$email = $parent['email'] ?? '';
|
||||
|
||||
return is_string($email) && trim($email) !== '';
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -9,12 +9,13 @@ class BroadcastEmailSenderOptionsService
|
||||
$json = getenv('MAIL_SENDERS') ?: env('MAIL_SENDERS', '{}');
|
||||
$arr = json_decode($json, true);
|
||||
|
||||
if (!is_array($arr) || empty($arr)) {
|
||||
if (! is_array($arr) || empty($arr)) {
|
||||
$smtpUser = getenv('SMTP_USER') ?: '';
|
||||
$name = 'Al Rahma Sunday School';
|
||||
|
||||
return [[
|
||||
'key' => 'general',
|
||||
'label' => $name . ($smtpUser ? " <{$smtpUser}>" : ''),
|
||||
'label' => $name.($smtpUser ? " <{$smtpUser}>" : ''),
|
||||
]];
|
||||
}
|
||||
|
||||
@@ -24,7 +25,7 @@ class BroadcastEmailSenderOptionsService
|
||||
$email = $info['email'] ?? '';
|
||||
$out[] = [
|
||||
'key' => (string) $key,
|
||||
'label' => trim($name . ($email ? " <{$email}>" : '')),
|
||||
'label' => trim($name.($email ? " <{$email}>" : '')),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user