sweflow/module-email
Composer 安装命令:
composer require sweflow/module-email
包简介
Módulo de envio de e-mails para a plataforma Sweflow API. Implementa a capability 'email-sender'.
README 文档
README
Este plugin fornece funcionalidades de envio de e-mail para a API Modular Sweflow. Ele utiliza o PHPMailer para garantir alta compatibilidade com diversos provedores SMTP.
Capability
Este módulo implementa a capability email-sender.
Ao instalar este plugin, o sistema Sweflow automaticamente o registrará como o provedor padrão para envio de e-mails, a menos que outro plugin com maior prioridade seja configurado.
Requisitos
- PHP >= 8.1
- Sweflow Core >= 1.0
Instalação
Instale via Composer:
composer require sweflow/module-email
Após a instalação, execute o comando de instalação do plugin para registrar as configurações e migrações necessárias:
php sweflow plugin:install email
Configuração
Adicione as seguintes variáveis ao seu arquivo .env na raiz do projeto Sweflow:
# Configurações de SMTP EMAIL_HOST=smtp.mailtrap.io EMAIL_PORT=2525 EMAIL_USERNAME=seu_usuario EMAIL_PASSWORD=sua_senha EMAIL_ENCRYPTION=tls # ou ssl # Remetente Padrão EMAIL_FROM=noreply@seudominio.com EMAIL_FROM_NAME="Sweflow System" # Debugging (opcional) EMAIL_DEBUG=false
Uso
O plugin registra o serviço EmailSenderInterface no container de dependência. Você pode injetá-lo em qualquer controller ou serviço do seu sistema.
Exemplo de Injeção de Dependência
use Src\Kernel\Contracts\EmailSenderInterface; class AuthController { public function __construct( private EmailSenderInterface $emailService ) {} public function register(Request $request) { // Lógica de registro... // Enviar e-mail de boas-vindas $this->emailService->send( to: $user->email, subject: 'Bem-vindo ao Sweflow!', body: '<h1>Obrigado por se registrar.</h1>' ); } }
Uso via Helper (se disponível)
Se o seu sistema tiver helpers configurados para capabilities:
app('email-sender')->send($to, $subject, $body);
Estrutura do Banco de Dados
Este plugin cria a tabela emails para log de envios (opcional, dependendo da configuração). As migrações estão localizadas em src/Database/Migrations.
Para rodar as migrações manualmente:
php sweflow plugin:migrate email
Contribuição
- Faça um Fork do projeto
- Crie sua Feature Branch (
git checkout -b feature/AmazingFeature) - Commit suas mudanças (
git commit -m 'Add some AmazingFeature') - Push para a Branch (
git push origin feature/AmazingFeature) - Abra um Pull Request
Licença
Distribuído sob a licença MIT. Veja LICENSE para mais informações.
sweflow/module-email 适用场景与选型建议
sweflow/module-email 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「email」 「module」 「smtp」 「phpmailer」 「sweflow」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sweflow/module-email 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sweflow/module-email 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sweflow/module-email 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Extensible library for building notifications and sending them via different delivery channels.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
bootstrap select field module implementing http://silviomoreto.github.io/bootstrap-select/
Laravel contact us form package to send email and save to database
Yii2 module to manage website content. Kind of a CMS...
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-06