markocupic / be_email
从Contao后端发送电子邮件。Contao开源CMS的后端扩展
3.4.1
2022-08-29 20:26 UTC
Requires
- php: ^8.0
- contao/core-bundle: ^4.13 || ^5.0
- markocupic/contao-component-vue-js: ^2.6
Requires (Dev)
Replaces
- contao-legacy/be_email: *
- dev-master
- 3.4.1
- 3.4.0
- 3.3.14
- 3.3.13
- 3.3.12
- 3.3.11
- 3.3.10
- 3.3.9
- 3.3.8
- 3.3.7
- 3.3.6
- 3.3.5
- 3.3.4
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- 3.2.3
- 3.2.2
- 3.2.1
- 3.2.0
- 3.1.14
- 3.1.13
- 3.1.12
- 3.1.11
- 3.1.10
- 3.1.9
- 3.1.8
- 3.1.7
- 3.1.6
- 3.1.5
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.1.0
- 3.0.10
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 2.2.0
- 1.3.15
This package is auto-updated.
Last update: 2024-08-29 04:09:03 UTC
README
Contao后端电子邮件
Contao电子邮件扩展,用于从Contao后端发送消息。在Contao设置中可以定义地址簿从何处获取地址。可以是tl_member、tl_user或两者。
兼容性
版本3.3仅与Contao >=4.9兼容。
希望您在使用Contao后端电子邮件时享受乐趣!
beEmailBeforeSend钩子
使用beEmailBeforeSend钩子可以在发送之前修改两个对象。为此,需要编写一个Contao钩子类。
为了通过注解注册钩子,需要在services.yml中注册它。
# services.yml
services:
_defaults:
autowire: true
autoconfigure: true
public: true
Vendorname\App\:
resource: ../../
exclude: ../../{DependencyInjection,Resources,Model,Widget}
钩子类可能看起来像这样。钩子期望三个参数,没有返回值。
<?php namespace Vendorname\App\Listener\ContaoHooks; use Contao\CoreBundle\ServiceAnnotation\Hook; /** * @Hook("beEmailBeforeSendHook") */ class BeEmailBeforeSendHook { /** * !!!Important * For manipulating data first and second parameter should be passed by reference! * @param $objEmail * @param $beEmailModel * @param $dc */ public function __invoke(&$objEmail, &$beEmailModel, $dc) { // f.ex. manipulate sender email address $objEmail->from = 'foo@myhost.com'; // f.ex. manipulate content $objEmail->text = 'bla bla!!'; $objEmail->html = 'bla bla!!'; } }