Download the PHP package fbeen/mailerbundle without Composer
On this page you can find all versions of the php package fbeen/mailerbundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fbeen/mailerbundle
More information about fbeen/mailerbundle
Files in fbeen/mailerbundle
Package mailerbundle
Short Description This bundle is a tiny layer on top of the Swift Mailer Bundle that is included in each standard Symfony framework
License MIT
Informations about the package mailerbundle
FbeenMailerBundle
This bundle is a tiny layer on top of the Swift Mailer Bundle that is included in each standard Symfony framework
Features include:
- Mailer helper class
- less configuration
- standard twig layout with optional logo
- easy configuration for used mailaddresses
- method to render example views
Installation
Using composer:
1) Add "fbeen/mailerbundle": "dev-master"
to the require section of your composer.json project file.
2) run composer update:
$ composer update
3) Add the bundle to the app/AppKernel.php:
Configuration
Take a look at this configuration example:
If the company_logo is a full URL then it will be used directly. Otherwise The mailer class will use treat it as an asset.
noreply: This is the From that the receiver will see in his email.
general: This is the Reply-to that will be set by default. if the receiver replies than you will receive his mail on this mailaddress
admins: This is the To of the receiver(s) set by default.
using names gives less spamscore
How to use
This can be easily shown with a few examples:
To send an email to the admins you don't need to use setTo()
To send an email to a user you will have to use setTo()
The mailer class will add addional data to the array before calling twig:
- companyName (the name of your company from the configuration)
- companyLogo (the path or full URL to an image of your choice)
- urlHomepage (the full URL to the "/" path of your website)
- subject (The subject that has been set by setSubject(); )
So for example 2 you could have a pair of templates as below.
layout.html.twig:
welcome.html.twig:
To render a page with an example content of the email: