digimantra/digi-email
最新稳定版本:v1.0.2
Composer 安装命令:
composer require digimantra/digi-email
包简介
A laravel package to send email.
README 文档
README
Table of Contents
Requirements
- Laravel 8, 9, or 10
- PHP 8.0 or higher
- Google API Client (installed automatically via composer)
- Firebase account with Cloud Messaging API enabled
Installation
Install via Composer
composer require digimantra/digi-email
Configuration
Update SMTP Settings
Modify your .env file to include your SMTP credentials:
MAIL_MAILER=smtp MAIL_HOST=smtp.yourservice.com MAIL_PORT=587 MAIL_USERNAME=your_email@domain.com MAIL_PASSWORD=your_password MAIL_ENCRYPTION=tls MAIL_FROM_ADDRESS=your_email@domain.com
Important: Clear the configuration cache with:
php artisan config:clear
Configure the Queue
Make sure you have set up your queue configuration in config/queue.php and have a queue driver configured (like database, Redis, etc.). If you're using the database driver, run the migration to create the jobs table:
php artisan queue:table php artisan migrate
Usage
Invoke the package’s email-sending function and provide the $data array as follows:
$data = [ 'to' => 'user@email.com', 'html' => true, 'content' => '<h1>Hi, test email</h1>', 'view' => '<path/to/view>', 'attachment' => false, ]; EmailHelper::sendEmail($data);
The package will handle the rest.
Queueing Emails
To process queued jobs, execute the following command in your terminal:
php artisan queue:work
Composer Requirements
The package relies on phpmailer/phpmailer for SMTP handling and is compatible with Laravel versions 8.x, 9.x, and 10.x.
License
This package is released under the MIT License. Refer to the LICENSE file for details.
Support
For support or more details you can reach out at it@digimantra.com.
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-20