weboccult / eatcard-mail-companion
This package is create mail service for eatcard subsystem.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 235
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^7.4|^8.0
- cmgmyr/messenger: ^2.21
- illuminate/support: ^8.0 || ^9.0
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2023-04-29 01:33:42 UTC
README
Eatcard Mail Companion
This companion package will help our team to manage to generic functionality and features at one place.
Installation
You can install the package via composer:
composer require weboccult/eatcard-mail-companion
Usage
use Weboccult\EatcardMailCompanion\Helpers\eatcardMailSend;
Available Services
- Create Mail : To generate mail template based on requirements
- Send Mail : To send mail via Laravel Queue/Jobs
Companion Config
here's how you can use publish companion config file to manage numerous settings
php artisan eatcardMailcompanion:publish --type=config
It will publish eatcardMailCompanion.php to your parent project
Basic Usage
Create Mail
- Payload : user requirements
- subject : Set mail subject
- recipients : Recipients user email address
- mailType : Type of mail (For developer)
- fromName : Mail sender name
- entityType : Type of mail (Where to get data)
- entityId : Get data based on entityId
- dispatch : Mail data dispatch in queue
- template : Direct send mail template to user without details
- bcc : Extra email addresses
- cc : Extra email addresses
use Weboccult\EatcardMailCompanion\Helpers\eatcardMailSend; eatcardMailSend() ->payload(['store_id' => $order['store_id'], 'recipient_type' => 'order.done']) ->subject(__('messages.takeaway_order_done_mail_sub') . ' ' . getDutchDate($order['order_date'])) ->recipients($order['email']) ->bcc([]) ->cc([]) ->mailType('Order done mail from admin') ->fromName(env('MAIL_FROM_NAME')) ->template('Reservation create') ->entityType('order') ->entityId($order['id']) ->dispatch(); OR use Weboccult\EatcardMailCompanion\EatcardMailCompanion; EatcardMailCompanion:: payload(['store_id' => $order['store_id'], 'recipient_type' => 'order.done']) ->subject(__('messages.takeaway_order_done_mail_sub') . ' ' . getDutchDate($order['order_date'])) ->recipients($order['email']) ->bcc([]) ->cc([]) ->mailType('Order done mail from admin') ->fromName(env('MAIL_FROM_NAME')) ->template('Reservation create') ->entityType('order') ->entityId($order['id']) ->dispatch();
Send Mail
- Mail send from jobs (SendMailJobs)
- Create mail entry in mongoDb database after sending mail successfully to user
- If something went wrong in mail sending part then data moved on failed jobs table