Add mail dialog component, work on #12
This commit is contained in:
+8
-2
@@ -26,9 +26,15 @@
|
||||
Route::put('/invoices/{id}', [InvoiceController::class, 'update']);
|
||||
Route::delete('/invoices/{id}', [InvoiceController::class, 'delete']);
|
||||
|
||||
Route::get('/invoices/{id}/remind', function ($id) {
|
||||
Route::get('/invoices/{id}/remind/{recipient}', function ($id, $recipient) {
|
||||
if (empty($recipient) || !filter_var($recipient, FILTER_VALIDATE_EMAIL)) {
|
||||
return response()->json([
|
||||
'error' => 'Keine gültige E_Mail-Adresse'
|
||||
], 400);
|
||||
}
|
||||
|
||||
$invoice = InvoiceController::single($id);
|
||||
Mail::to('daniel@vollstock.de')->send(new Reminder($invoice));
|
||||
Mail::to($recipient)->send(new Reminder($invoice));
|
||||
// return new Reminder($invoice);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user