andreas-glaser / notify-bundle
A symfony bundle, making it easy to send email, sms and other notifications
Installs: 527
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^7
- andreas-glaser/php-helpers: @stable
- symfony/symfony: 2.8.*
Requires (Dev)
- phpunit/phpunit: @stable
- symfony/phpunit-bridge: ^3.2
- symfony/var-dumper: @stable
This package is auto-updated.
Last update: 2023-11-05 02:28:19 UTC
README
A symfony bundle, making it easy to send email, sms and other notifications
Requirements
- PHP 7.x
- Symfony 2.8.x LTS
Installation
composer require andreas-glaser/notify-bundle dev-master
Usage
Define Emails
# app/config/config.yml andreas_glaser_notify: enabled: true channels: email: from_name: "Default Name" from_email: "my-default-from-email@email.com" emails: example_email: subject: Welcome :name" template_content: "AppBundle:Email:exampleEmail.html.twig"
Run following console command for a full list of config options.
./app/console config:dump-reference andreas_glaser_notify
Send Email
<?php $subjectData = [ ':name' => 'Some name' ]; $bodyData = []; /** @var \AndreasGlaser\NotifyBundle\Channel\Email\Email $email */ $email = $this ->container ->get('andreas_glaser_notify.channel_email.loader') ->load('example_email', $bodyData, $subjectData); $this->container ->get('andreas_glaser_notify.channel.email.dispatcher') ->dispatch($email);