承接 buibr/laramic-mailer 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

buibr/laramic-mailer

最新稳定版本:v0.1

Composer 安装命令:

composer require buibr/laramic-mailer

包简介

When you need dynamic mailing, multiple mail server

README 文档

README

Laramic Mailer is a Laravel plugin that allows dynamic email configuration based on database-stored settings. This package makes it easy to manage multiple mail configurations and send emails without hardcoding your email settings in .env files.

Features

  • Dynamic Mail Configuration: Fetch mail settings from the database and apply them on the fly.
  • Seamless Integration: Easily integrates with Laravel's native mail functionality.
  • Multi-Mailer Support: Supports multiple mailers for different use cases.
  • Flexible Setup: Define your own mailer configurations in the database, including SMTP host, port, encryption, and more.
  • Configurable Sender Info: Dynamically configure "From" name and address for each mail.
  • Extensible: Customize how mail configurations are stored and retrieved.

Installation

Step 1: Install via Composer

To install the package, run the following command:

composer require buibr/laramic-mailer

Step 2: Publish Configuration and Migration

After installation, publish the configuration and migration files:

php artisan vendor:publish --tag=laramic-mailer-config
php artisan migrate

Usage

Add your mail configurations directly in the database (SMTP host, port, encryption, etc.). When sending emails, the plugin will fetch the necessary mailer configuration from the database and apply it on the fly. You can define and manage multiple mailers for different purposes, all stored in the database.

Example to use of Dynami MailServer server and laramic with defualt laravel functionality:

// from
Mail::to($request->user())->send(new OrderShipped($order));

// to
Laramic::use($ticketCommunication->mailServer)
    ->to($request->user())
    ->send(new InvoiceEmail(Invoice $invoice));

All other laravel Mail or MailManager methods as parent layer of Laramic can be used normaly. See: https://laravel.com/docs/11.x/mail[url](https://laravel.com/docs/11.x/mail)]

Testing

<?php
use Laramic\Mailers\Facades\Laramic;
use Laramic\Mailers\Models\Laramic;

// Call this method to send test email to authenticated user
Laramic::testMail(MailServer $mailServer);

// Call this method to ping the email server, if configuration is wrong, then the ping will fail.
Laramic::ping(MailServer $mailServer);

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-09-09