eve mailer again

This commit is contained in:
2020-01-31 21:00:43 -06:00
parent ad421a809a
commit 06256f223c
3 changed files with 11 additions and 5 deletions

View File

@@ -12,6 +12,8 @@ use App\Jobs\ProcessSendEveMailJob;
//Library
use Commands\Library\CommandHelper;
use App\Library\Moons\MoonCalc;
use App\Library\Esi\Esi;
use Seat\Eseye\Exceptions\RequestFailedException;
//Models
use App\Models\Moon\Moon;
@@ -101,7 +103,7 @@ class MoonMailerCommand extends Command
$body .= "Warped Intentions Leadership<br>";
//Dispatch the mail job
$mail = new EveMail;
$mail = new JobSendEveMail;
$mail->sender = $config['primary'];
$mail->subject = "Warped Intentions Moon Rental Payment Due for " . $today->englishMonth;
$mail->body = $body;
@@ -111,6 +113,8 @@ class MoonMailerCommand extends Command
//Increment the delay for the mail to not hit rate limits
$delay += 30;
$this->SendMail($mail);
//Update the moon as not being paid for the next month?
foreach($rentals as $rental) {
$previous = new Carbon($rental->Paid_Until);
@@ -125,6 +129,10 @@ class MoonMailerCommand extends Command
$task->SetStopStatus();
}
private function SendMail(EveMail $mail) {
}
private function UpdateNotPaid(MoonRental $rental) {
MoonRental::where([
'System' => $rental->System,

View File

@@ -50,7 +50,7 @@ class ProcessSendEveMailJob implements ShouldQueue
*
* @return void
*/
public function __construct(EveMail $mail) {
public function __construct(JobSendEveMail $mail) {
$this->body = $mail->body;
$this->recipient = $mail->recipient;
$this->recipient_type = $mail->recipient_type;

View File

@@ -7,7 +7,7 @@ use Illuminate\Database\Eloquent\Model;
class JobSendEveMail extends Model
{
//Timestamps
public $timestamps = true;
public $timestamps = false;
protected $fillable = [
'sender',
@@ -15,7 +15,5 @@ class JobSendEveMail extends Model
'recipient_type',
'subject',
'body',
'created_at',
'updated_at',
];
}