Validating subscribers
When integrating this package into your app you will likely build a UI where people can subscribe to your list. This package provides a validation rule that verifies that given email address isn’t already on the given email list. You can use it like this:
// in a form request public function rules() { $emailList = EmailList::first(); return [ 'email' => ['email', new Spatie\Mailcoach\Rules\EmailListSubscriptionRule($emailList)] ]; }
You can customize the validation error message publishing the lang files.
php artisan vendor:publish --provider="Spatie\Mailcoach\MailcoachServiceProvider" --tag="mailcoach-translations"
You’ll find the message in resources/lang/en/messages.php
.