- Created MailTestController to handle email sending requests. - Added SendTestMailRequest for validating email input. - Developed MailTestService to manage email sending logic. - Introduced TestMail Mailable for formatting test emails. - Defined API route for sending test emails. - Created EmailIntegrationSeeder to seed email integration settings. - Updated DatabaseSeeder to include EmailIntegrationSeeder. - Added MailTestControllerTest to ensure email sending functionality works as expected.
26 lines
541 B
PHP
26 lines
541 B
PHP
<?php
|
|
|
|
namespace App\Domains\MailTest\Requests;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class SendTestMailRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @return array<string, array<int, string>>
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'to' => ['required', 'string', 'email', 'max:255'],
|
|
'subject' => ['nullable', 'string', 'max:255'],
|
|
'message' => ['nullable', 'string', 'max:5000'],
|
|
];
|
|
}
|
|
}
|