quextum / emails
发送电子邮件
1.0.10
2022-06-08 08:28 UTC
Requires
- php: >=8.0
- ext-json: *
- latte/latte: ^2.10
- nette/application: ^3.1
- nette/caching: ^3.0
- nette/http: ^3.0
- nette/mail: ^3.1
- nette/schema: ^1.0
- nette/utils: ^3.0
- tracy/tracy: ^2.6
Requires (Dev)
- nette/bootstrap: ^3.1
- nette/di: ^3.0
- nette/tester: ^2.0
README
配置
在配置文件 config.neon 中注册扩展
extensions: emails: App\Emails\EmailsExtension
之后设置扩展。示例配置
parameters: domain: domain.com title: Title emails: templates: '%appDir%/emails/templates' default: from: [noreply@%domain%, %title%] password < default: subject: Nastavení hesla na stránkách %domain% variables: imagesUrl: https://cdn.domain.com/xyz/ registration < default: subject: Byl jste přidán do systému %domain% notification < default: subject: Notifikace ze systému %domain% contact < default: subject: Zpráva z kontaktního formuláře serveru %domain% attachment: - %appDir%/emails/assets/about_blank.pdf embed: - %appDir%/emails/assets/prosky-logo.png to: test@email.cz: Jan Novák - test2@email.com - "Jan Novák <test3@email.com>"
可设置
to
from
subject
cc
bcc
reply
return
embed
attachment
用法
在演示者中
$this->context->getService('emails')->send('registration', ['to' => $user->email],['userEntity'=> $user]);
参数
- 类型。必须存在指定类型的配置和同名模板。
- 设置。此设置将与配置中定义的设置关联。方法参数中的设置比配置文件中的设置具有更高的权重。
- 模板变量。