mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 02:50:39 +00:00
queueable email sharing
This commit is contained in:
@@ -1,20 +1,21 @@
|
||||
<?php
|
||||
namespace Domain\Sharing\Actions;
|
||||
|
||||
use Spatie\QueueableAction\QueueableAction;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
use Domain\Sharing\Notifications\SharedSendViaEmail;
|
||||
|
||||
class SendViaEmailAction
|
||||
{
|
||||
use QueueableAction;
|
||||
|
||||
public function __invoke(
|
||||
array $emails,
|
||||
string $token,
|
||||
): void {
|
||||
foreach ($emails as $email) {
|
||||
Notification::route('mail', $email)
|
||||
->notify(
|
||||
new SharedSendViaEmail($token)
|
||||
);
|
||||
->notify(new SharedSendViaEmail($token));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,9 +41,9 @@ class ShareController extends Controller
|
||||
|
||||
// Send shared link via email
|
||||
if ($request->has('emails')) {
|
||||
($sendLinkToEmailAction)(
|
||||
$request->input('emails'),
|
||||
$shared->token
|
||||
$sendLinkToEmailAction->onQueue()->execute(
|
||||
emails: $request->input('emails'),
|
||||
token: $shared->token
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class ShareViaEmailController extends Controller
|
||||
Request $request,
|
||||
string $token,
|
||||
): Response {
|
||||
($this->sendLinkToEmailAction)(
|
||||
($this->sendLinkToEmailAction)->onQueue()->execute(
|
||||
emails: $request->input('emails'),
|
||||
token: $token,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user