Symfony 邮件模板、变量和附件集成Bundle

安装次数: 1,691

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 3

分支: 0

类型:symfony-bundle

v0.2.6 2017-05-09 14:06 UTC

This package is not auto-updated.

Last update: 2024-09-14 18:58:35 UTC


README

1. 基本配置

youshido_mail:
    config:
        from: test@test.com # default from for all emails
    emails:
        registration_success: # email config id
            subject:  Welcome to our service #not necessary
            template: '@App/emails/register-success.html.twig'
            from: billing@test.com # optional From for this config
        personal_reminder: # email config id
            subject:  Hi %name%, your reminder is here!
            template: '@App/emails/register-success.html.twig'
            from: billing@test.com # optional From for this config

2. 使用方法

$mailer = $this->container->get('youshido.mailer');
$mailer->sendEmailWithId('registration_success', 'user@test.com', ['name' => 'Alex']);

$mailer->sendEmailWithId('personal_reminder', 'user@test.com', ['name' => 'Alex']);