Refactor Email Integration Handling
- Removed the AbstractEmailIntegrationHandler class to streamline email integration logic. - Updated EmailIntegration class to extend AbstractIntegrationHandler instead of the removed class. - Modified FormEmailNotification to handle mailer configuration internally, eliminating the need to pass the mailer as a parameter. These changes enhance the clarity and maintainability of the email integration process by consolidating configuration logic and reducing class dependencies.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
use App\Notifications\Forms\FormEmailNotification;
|
||||
use Tests\Helpers\FormSubmissionDataFactory;
|
||||
use Illuminate\Notifications\AnonymousNotifiable;
|
||||
use Illuminate\Support\Facades\Notification;
|
||||
|
||||
it('can not save custom SMTP settings if not pro user', function () {
|
||||
$user = $this->actingAsUser();
|
||||
@@ -54,8 +55,12 @@ it('send email with custom SMTP settings', function () {
|
||||
new AnonymousNotifiable(),
|
||||
FormEmailNotification::class,
|
||||
function (FormEmailNotification $notification, $channels, $notifiable) {
|
||||
$renderedMail = $notification->toMail($notifiable);
|
||||
return $notifiable->routes['mail'] === 'test@test.com' &&
|
||||
$notification->mailer === 'custom_smtp';
|
||||
config('mail.mailers.custom_smtp.host') === 'custom.smtp.host' &&
|
||||
config('mail.mailers.custom_smtp.port') === '587' &&
|
||||
config('mail.mailers.custom_smtp.username') === 'custom_username' &&
|
||||
config('mail.mailers.custom_smtp.password') === 'custom_password';
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user