eve mailer again
This commit is contained in:
@@ -12,6 +12,8 @@ use App\Jobs\ProcessSendEveMailJob;
|
|||||||
//Library
|
//Library
|
||||||
use Commands\Library\CommandHelper;
|
use Commands\Library\CommandHelper;
|
||||||
use App\Library\Moons\MoonCalc;
|
use App\Library\Moons\MoonCalc;
|
||||||
|
use App\Library\Esi\Esi;
|
||||||
|
use Seat\Eseye\Exceptions\RequestFailedException;
|
||||||
|
|
||||||
//Models
|
//Models
|
||||||
use App\Models\Moon\Moon;
|
use App\Models\Moon\Moon;
|
||||||
@@ -101,7 +103,7 @@ class MoonMailerCommand extends Command
|
|||||||
$body .= "Warped Intentions Leadership<br>";
|
$body .= "Warped Intentions Leadership<br>";
|
||||||
|
|
||||||
//Dispatch the mail job
|
//Dispatch the mail job
|
||||||
$mail = new EveMail;
|
$mail = new JobSendEveMail;
|
||||||
$mail->sender = $config['primary'];
|
$mail->sender = $config['primary'];
|
||||||
$mail->subject = "Warped Intentions Moon Rental Payment Due for " . $today->englishMonth;
|
$mail->subject = "Warped Intentions Moon Rental Payment Due for " . $today->englishMonth;
|
||||||
$mail->body = $body;
|
$mail->body = $body;
|
||||||
@@ -111,6 +113,8 @@ class MoonMailerCommand extends Command
|
|||||||
//Increment the delay for the mail to not hit rate limits
|
//Increment the delay for the mail to not hit rate limits
|
||||||
$delay += 30;
|
$delay += 30;
|
||||||
|
|
||||||
|
$this->SendMail($mail);
|
||||||
|
|
||||||
//Update the moon as not being paid for the next month?
|
//Update the moon as not being paid for the next month?
|
||||||
foreach($rentals as $rental) {
|
foreach($rentals as $rental) {
|
||||||
$previous = new Carbon($rental->Paid_Until);
|
$previous = new Carbon($rental->Paid_Until);
|
||||||
@@ -125,6 +129,10 @@ class MoonMailerCommand extends Command
|
|||||||
$task->SetStopStatus();
|
$task->SetStopStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function SendMail(EveMail $mail) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private function UpdateNotPaid(MoonRental $rental) {
|
private function UpdateNotPaid(MoonRental $rental) {
|
||||||
MoonRental::where([
|
MoonRental::where([
|
||||||
'System' => $rental->System,
|
'System' => $rental->System,
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class ProcessSendEveMailJob implements ShouldQueue
|
|||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function __construct(EveMail $mail) {
|
public function __construct(JobSendEveMail $mail) {
|
||||||
$this->body = $mail->body;
|
$this->body = $mail->body;
|
||||||
$this->recipient = $mail->recipient;
|
$this->recipient = $mail->recipient;
|
||||||
$this->recipient_type = $mail->recipient_type;
|
$this->recipient_type = $mail->recipient_type;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
class JobSendEveMail extends Model
|
class JobSendEveMail extends Model
|
||||||
{
|
{
|
||||||
//Timestamps
|
//Timestamps
|
||||||
public $timestamps = true;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'sender',
|
'sender',
|
||||||
@@ -15,7 +15,5 @@ class JobSendEveMail extends Model
|
|||||||
'recipient_type',
|
'recipient_type',
|
||||||
'subject',
|
'subject',
|
||||||
'body',
|
'body',
|
||||||
'created_at',
|
|
||||||
'updated_at',
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user