aiqedge/smtp-notifications-channel
Laravel notification channel to send emails via the AIQEDGE SMTP API. Configure credentials in .env/services.php, add AiqedgeSmtpChannel to via(), and return message data from toAiqedgeSmtp(). Failed requests are logged via Laravel.
A Laravel notification channel for sending emails via the AIQEDGE SMTP API. This package lets you deliver notifications using AIQEDGE's SMTP service, making it easy to integrate external email delivery into your Laravel applications.
Install the package via Composer:
composer require aiqedge/smtp-notifications-channel
Add your AIQEDGE SMTP credentials to your .env file:
AIQEDGE_SMTP_KEY=your-api-key-here
AIQEDGE_SMTP_URL=https://api.aiqedge.com/smtp
Then, add the following to your config/services.php:
'aiqedge_smtp' => [
'key' => env('AIQEDGE_SMTP_KEY'),
'url' => env('AIQEDGE_SMTP_URL'),
],
In your notification class, add the via() method to specify the channel:
public function via($notifiable)
{
return [AiqedgeSmtpChannel::class];
}
toAiqedgeSmtp() MethodAdd a toAiqedgeSmtp() method to your notification class. This should return an array with the email details:
public function toAiqedgeSmtp($notifiable)
{
return [
'to' => $notifiable->email,
'subject' => 'Your Subject',
'body' => 'Your message body',
// Add other fields as required by AIQEDGE SMTP API
];
}
Use Laravel's notification system as usual:
$user->notify(new YourNotification());
To see the possible request body and required fields, visit this Postman collection:
AIQEDGE SMTP Send Email Request Example (Postman)
use Aiqedge\SmtpNotificationsChannel\AiqedgeSmtpChannel;
use Illuminate\Notifications\Notification;
class InvoicePaid extends Notification
{
public function via($notifiable)
{
return [AiqedgeSmtpChannel::class];
}
public function toAiqedgeSmtp($notifiable)
{
return [
'to' => $notifiable->email,
'subject' => 'Invoice Paid',
'body' => 'Your invoice has been paid.',
];
}
}
If the API request fails, the error will be logged using Laravel's logging system. Check your logs for details.
This package is open-sourced software licensed under the MIT license.
How can I help you explore Laravel packages today?