beebmx/kirby-email-plus
最新稳定版本:1.2.1
Composer 安装命令:
composer require beebmx/kirby-email-plus
包简介
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
README 文档
README
Email+ for Kirby
Kirby has a built-in email engine with support for mail and smtp transports.
However, sometimes you may need more support for other email services like Mailgun or Resend.
Kirby Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
Overview
Installation
Right now, Email+ supports two additional email transports: mailgun and resend.
Mailgun installation
To use Mailgun as your email transport, you need to run the following command to install the required packages:
composer require beebmx/kirby-email-plus mailgun/mailgun-php symfony/http-client nyholm/psr7
Resend installation
To use Resend as your email transport, you need to run the following command to install the required packages:
composer require beebmx/kirby-email-plus resend/resend-php
Usage
With Kirby Email+ you can choose between the built-in Kirby email transports (mail and smtp) and the new ones added by this plugin (mailgun and resend).
First you need to configure the email transport you want to use in your config.php file:
return [ 'beebmx.email-plus' => [ 'type' => 'resend', 'resend.key' => 're_XXXXXXXXXXXXXXXX', ], ];
Then, you can send emails using the Kirby email API as usual:
$kirby->email([ 'from' => 'welcome@supercompany.com', 'replyTo' => 'no-reply@supercompany.com', 'to' => 'someone@gmail.com', 'cc' => 'anotherone@gmail.com', 'bcc' => 'secret@gmail.com', 'subject' => 'Welcome!', 'body' => 'It\'s great to have you with us', ]);
For convinience, you can also set the type directly in the transport configuration:
return [ 'email' => [ 'transport' => [ 'type' => 'resend', ], ], 'beebmx.email-plus.resend.key' => 're_XXXXXXXXXXXXXXXX', ];
Options
| Option | Type | Default | Description |
|---|---|---|---|
| beebmx.email-plus.type | string |
null | Define the email transport mailgun or resend |
| beebmx.email-plus.mailgun.domain | string |
null | Define your mailgun domain to send emails. |
| beebmx.email-plus.mailgun.endpoint | string |
https://api.mailgun.net | https://api.eu.mailgun.net for EU servers. |
| beebmx.email-plus.mailgun.key | string |
null | Define your API Key for mailgun |
| beebmx.email-plus.resend.key | string |
null | Define your API Key for resend |
Here's an example of a full use of the options from the config.php file:
return [ 'beebmx.email-plus' => [ 'type' => 'resend', // mailgun or resend 'mailgun' => [ 'domain' => 'example.com', 'endpoint' => 'https://api.mailgun.net', 'key' => 'key-XXXXXXXXXXXXXXXX', ], 'resend' => [ 'key' => 're_XXXXXXXXXXXXXXXX', ], ], ];
License
Licensed under the MIT.
Credits
- Fernando Gutierrez @beebmx
- All Contributors
统计信息
- 总下载量: 93
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-11-03
