Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Jobs;
use App\Mail\ReactionCreatedEmail;
use App\Mail\ReactionCreatedMail;
use Cog\Contracts\Love\Reaction\Models\Reaction;
use Cog\Laravel\Love\Reaction\Events\ReactionHasBeenAdded;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldBeUnique;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Facades\Mail;
class SendReactionCreatedMail implements ShouldQueue
{
use Dispatchable;
use InteractsWithQueue;
use Queueable;
use SerializesModels;
public $tries = 3;
public $backoff = [5,30,300]; // wait for 5, 30, or 300 sec before worker tries again
public $reaction;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct(Reaction $reaction)
{
$this->reaction = $reaction;
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
// Send the email to the recipient (person receiving the reaction)
Mail::to($this->reaction->getReactant()->getReactable()->email)->send(new ReactionCreatedMail($this->reaction));
}
}