Download the PHP package eubourne/laravel-mailgun without Composer
On this page you can find all versions of the php package eubourne/laravel-mailgun. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-mailgun
Laravel Mailgun
Laravel Mailgun is a custom Laravel Mailgun driver that enables you to configure individual domains for multiple mailers, providing enhanced flexibility and precise control over email delivery.
- Features
- Installation
- Basic Usage
- Utilities
- License
- Contributing
-
Contact
Features
- Per-mailer Domain Configuration: Assign unique domains to specific mailers, ideal for multi-domain email setups.
- Powered by the Mailgun API: Utilizes the official Mailgun API for reliable, secure email delivery.
-
Helper tools: Includes a user-friendly Artisan command to send test emails, making it easy to verify email configurations and troubleshoot deliverability issues.
Installation
To install the package, run:
This package supports Laravel's package auto-discovery feature, so no manual service provider registration is required.
Basic Usage
1. Configure Mailgun API Settings
In your config/services.php
file, add the Mailgun API credentials:
2. Define a Mailer
Update or create a new mailer in your config/mail.php
file, specifying the mailgun-api
transport:
3. Set Environment Variables
Add the required Mailgun-specific values to your .env
file.
4. Use the Mailer
When sending a mailable, specify your custom mailer:
Setting a Default Mailer for a Mailable
If you want to always send a specific mailable using a particular mailer,
you can define it with a public $mailer
property in your mailable class:
Alternatively, you can use the mailer($mailerName)
method on your mailable
instance to set the mailer dynamically at runtime:
Important Notes:
- The mailer specified with the
mailer
property ormailer()
method will override the mailer used to initiate the send operation. - For instance, the following code will send the email using the
transactional
mailer, even though thepromotional
mailer is used to send the email:
This flexibility allows you to set a default mailer for each mailable while retaining the ability to override it dynamically.
Utilities
The package comes with a helpful Artisan command for testing email configuration and deliverability:
Whitelist Addresses
Before sending test emails, whitelist the recipient addresses by adding a whitelist
key to your config/mail.php
file:
Example Usage
Send a test email to a whitelisted address:
Specify a mailer for the test:
Send the email through a specific queue:
License
This package is open-source and available for free under the MIT license.
Contributing
Feel free to submit issues or pull requests to help improve this package.
Contact
For more information or support, please reach out via GitHub or email.
All versions of laravel-mailgun with dependencies
mailgun/mailgun-php Version ^4.3
nyholm/psr7 Version ^1.8
symfony/mailer Version ^7.1
illuminate/mail Version ^11.33
psr/http-client Version ^1.0
laravel/prompts Version ^0.3.2
illuminate/console Version ^11.33
illuminate/validation Version ^11.33
symfony/var-dumper Version ^7.1
illuminate/config Version ^11.33