djurovicigoor / postmark-bounced-email-blocker
This package will prevent sending an email to addresses that marked an email as bounced or spam in your postmark email stream.
Requires
- php: ^8.1
- ext-json: *
- guzzlehttp/guzzle: ^7.7
- illuminate/cache: ^8.0|^9.0|^10.0|^11.0
- illuminate/config: ^8.0|^9.0|^10.0|^11.0
- illuminate/console: ^8.0|^9.0|^10.0|^11.0
- illuminate/contracts: ^8.0|^9.0|^10.0|^11.0
- illuminate/support: ^8.0|^9.0|^10.0|^11.0
- illuminate/validation: ^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- mockery/mockery: ^1.4.2
- orchestra/testbench: *
- phpunit/phpunit: ^9.5.10
This package is auto-updated.
Last update: 2024-11-15 08:20:41 UTC
README
Adds a validator to Laravel for checking whether a given email address isn't blocked in your Postmark stream.
Installation
-
Run the Composer require command to install the package:
composer require djurovicigoor/postmark-bounced-email-blocker
-
If you don't use auto-discovery, open up your app config and add the Service Provider to the
$providers
array:'providers' => [ ... Djurovicigoor\PostmarkBouncedEmailBlocker\PostmarkBouncedEmailBlockerServiceProvider::class, ],
-
Publish the configuration file and adapt the configuration as desired:
php artisan vendor:publish --tag=postmark-bounced-email-blocker
-
Run the following artisan command to fetch an up-to-date list of blocked emails:
php artisan postmark-bounced-email:fetch
-
(optional) In your languages directory, add for each language an extra language line for the validator:
'bounced_email_in_postmark' => 'It\'s not possible to send email to this address because the recipient has flagged your previous email as spam.',
-
(optional) It's highly advised to update the blocked emails list regularly. You can either run the command yourself now and then or, if you make use of Laravel's scheduler, include it over there (
App\Console\Kernel
):protected function schedule(Schedule $schedule) { $schedule->command('postmark-bounced-email:fetch')->daily(); }
Usage
Use the bounced_email_in_postmark
validator to ensure a given field doesn't hold a blocked email address. You'll probably want to add it after the email
validator to make sure a valid email is passed through:
'field' => 'email|bounced_email_in_postmark',