mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Rename ScheduleEntity -> EmailRecord
This commit is contained in:
parent
8fff97ac4b
commit
915a99fd56
36
app/DataMapper/Schedule/EmailRecord.php
Normal file
36
app/DataMapper/Schedule/EmailRecord.php
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\DataMapper\Schedule;
|
||||
|
||||
class EmailRecord
|
||||
{
|
||||
/**
|
||||
* Defines the template name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public string $template = 'email_record';
|
||||
|
||||
/**
|
||||
* Defines the template name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public string $entity = ''; // invoice, credit, quote, purchase_order
|
||||
|
||||
/**
|
||||
* Defines the template name
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public string $entity_id = '';
|
||||
}
|
34
app/Services/Scheduler/EmailRecord.php
Normal file
34
app/Services/Scheduler/EmailRecord.php
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Services\Scheduler;
|
||||
|
||||
use App\Models\Scheduler;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
|
||||
class EmailRecord
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
public function __construct(public Scheduler $scheduler)
|
||||
{
|
||||
}
|
||||
|
||||
public function run()
|
||||
{
|
||||
$class = 'App\\Models\\' . Str::camel($this->scheduler->parameters['entity']);
|
||||
|
||||
$class::find($this->decodePrimaryKey($this->scheduler->parameters['entity_id']))->service()->sendEmail();
|
||||
|
||||
$this->scheduler->forceDelete();
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user