Added msg in import transit mail
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 1m55s
Laravel Larastan / larastan (pull_request) Failing after 3m21s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 16s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 19s
Laravel Pint / pint (pull_request) Successful in 1m55s
Laravel Larastan / larastan (pull_request) Failing after 3m21s
This commit is contained in:
@@ -4,8 +4,10 @@ namespace App\Console\Commands;
|
|||||||
|
|
||||||
use App\Mail\ImportTransitMail;
|
use App\Mail\ImportTransitMail;
|
||||||
use App\Models\AlertMailRule;
|
use App\Models\AlertMailRule;
|
||||||
|
use App\Models\EmployeeMaster;
|
||||||
use App\Models\ImportTransit;
|
use App\Models\ImportTransit;
|
||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
|
use Filament\Facades\Filament;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
use App\Exports\ImportTransitReportExport;
|
use App\Exports\ImportTransitReportExport;
|
||||||
@@ -81,11 +83,22 @@ class SendImportTransit extends Command
|
|||||||
'local'
|
'local'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$updatedBy = $tableData->last()?->updated_by;
|
||||||
|
|
||||||
|
$employee = EmployeeMaster::where('code', $updatedBy)
|
||||||
|
->select('name', 'mobile_number')
|
||||||
|
->first();
|
||||||
|
|
||||||
|
$employeeName = $employee?->name;
|
||||||
|
$mobileNumber = $employee?->mobile_number;
|
||||||
|
|
||||||
$mail = new ImportTransitMail(
|
$mail = new ImportTransitMail(
|
||||||
$scheduleType,
|
$scheduleType,
|
||||||
$tableData,
|
$tableData,
|
||||||
$mailSubject,
|
$mailSubject,
|
||||||
$fileName
|
$fileName,
|
||||||
|
$employeeName,
|
||||||
|
$mobileNumber,
|
||||||
);
|
);
|
||||||
|
|
||||||
$toEmails = collect(explode(',', $rule->email))
|
$toEmails = collect(explode(',', $rule->email))
|
||||||
@@ -111,11 +124,9 @@ class SendImportTransit extends Command
|
|||||||
->cc($ccEmails)
|
->cc($ccEmails)
|
||||||
->send($mail);
|
->send($mail);
|
||||||
|
|
||||||
$this->info(
|
$this->info("Mail sent → Rule {$rule->id} | To: " . implode(', ', $toEmails));
|
||||||
"Mail sent → Rule {$rule->id} | To: " . implode(', ', $toEmails)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,15 +23,21 @@ class ImportTransitMail extends Mailable
|
|||||||
|
|
||||||
public $excelPath;
|
public $excelPath;
|
||||||
|
|
||||||
|
public $name;
|
||||||
|
|
||||||
|
public $mobileNo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new message instance.
|
* Create a new message instance.
|
||||||
*/
|
*/
|
||||||
public function __construct($scheduleType, $tableData, $mailSubject, $excelPath)
|
public function __construct($scheduleType, $tableData, $mailSubject, $excelPath, $name, $mobileNo)
|
||||||
{
|
{
|
||||||
$this->scheduleType = $scheduleType;
|
$this->scheduleType = $scheduleType;
|
||||||
$this->tableData = $tableData ?? [];
|
$this->tableData = $tableData ?? [];
|
||||||
$this->mailSubject = $mailSubject ?? 'Import Transit';
|
$this->mailSubject = $mailSubject ?? 'Import Transit';
|
||||||
$this->excelPath = $excelPath;
|
$this->excelPath = $excelPath;
|
||||||
|
$this->name = $name;
|
||||||
|
$this->mobileNo = $mobileNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,7 +87,7 @@ class ImportTransitMail extends Mailable
|
|||||||
'company' => 'CRI Digital Manufacturing Solutions',
|
'company' => 'CRI Digital Manufacturing Solutions',
|
||||||
'greeting' => $greeting,
|
'greeting' => $greeting,
|
||||||
'tableData' => $this->tableData,
|
'tableData' => $this->tableData,
|
||||||
'wishes' => 'Thanks & Regards,<br>CRI Digital Manufacturing Solutions',
|
'wishes' => "Thanks & Regards,<br>CRI Digital Manufacturing Solutions<br><b>Updated By</b> - $this->name<br>For any queries, please contact the number below<br>+91 $this->mobileNo",
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user