Skip to content

youshido-php/MailBundle

Repository files navigation

Mail Bundle

1. Basic config:

youshido_mail:
    config:
        from: [email protected] # 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: [email protected] # 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: [email protected] # optional From for this config

2. Usage:

$mailer = $this->container->get('youshido.mailer');
$mailer->sendEmailWithId('registration_success', '[email protected]', ['name' => 'Alex']);

$mailer->sendEmailWithId('personal_reminder', '[email protected]', ['name' => 'Alex']);