plusforta/postmark-bundle
最新稳定版本:1.2.6
Composer 安装命令:
composer require plusforta/postmark-bundle
包简介
This bundle enables postmark template emails for symfony
README 文档
README
The plusforta/postmark-bundle is a bundle for the Symfony framework for sending template mails via PostmarkApp
Installation
## Versions
Right now this bundle is only used by the onlineantrag-php (ERP) project. It is using version "^1.2"
| Version | Symfony Version | Branch |
|---------|:---------------:|--------|
| 1.0 | 5.4 | none |
| 1.1 | 5.4 | none |
| 1.2 | 6.3 | master |
## Configuration
The configuration can be created in `config/packages/plusforta_postmark.yaml` with the following structure:
```
plusforta_postmark:
servers:
- {name: 'plusforta.de', api_key: '%env(POSTMARK_KEY_PLUSFORTA)%'}
- {name: 'test', api_key: '%env(POSTMARK_KEY_TEST)%'}
defaults:
from:
email: "info@kautionsfrei.de"
name: "PlusForta GmbH"
overrides:
to:
email: jan.hentschel@plusforta.de
disable_delivery: true
```
Specific configurations for the environments can be stored under dev, prod and test.
### Mandatory configuration information:
The server configuration must be specified:
`plusforta_postmark.servers`.
The value corresponds to the name of the server and its API key.
### Optional:
#### defaults
It is possible to create a default value for the sender (`plusforta_postmark.defaults.email`
or `plusforta_postmark.defaults.name`).
#### overrides
It is possible to permanently overwrite the recipient (`plusforta_postmark.overrides.to.email`). This is useful for
dev and staging environment.
#### disable delivery
It is possible to deactivate email delivery (`plusforta_postmark.disable_delivery`), which means that no emails are sent
and no communication
and there is no communication with the Postmark server. This is useful for the test environment.
## Create new email template
An example of a mail template is `src/Mail/KFKundenanfrageTemplateMail.php`.
1. email inherits from `PlusForta\PostmarkBundle\Mail\BaseTemplateMail`.
2. `SERVER_ID` must be specified. This server must be stored in the configuration (`plusforta_postmark.servers`).
3. `TEMPLATE_ID` or `TEMPLATE_ALIAS` must be set. The `TEMPLATE_ID` corresponds to the ID or ALIAS of the template in
Postmark.
4. `$parameters` is an array with parameters that can be set for the template.
5. `getTemplate()` must be implemented. The return value is an associative array. A json_encode on the array
must correspond to the required JSON for the template at Postmark.
统计信息
- 总下载量: 234
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-04-29