Download the PHP package c975l/email-bundle without Composer
On this page you can find all versions of the php package c975l/email-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download c975l/email-bundle
More information about c975l/email-bundle
Files in c975l/email-bundle
Package email-bundle
Short Description Bundle to manage sending emails and store in a database
License MIT
Homepage https://github.com/975L/EmailBundle
Informations about the package email-bundle
EmailBundle
EmailBundle does the following:
- Stores email in a database as an option,
- Sends email using Symfony Mailer,
- Allows user with good ROLE to see emails sent,
- Defines a template for emails that should be overriden to integrate fully with website,
- Allows to attach one or multiple files.
EmailBundle dedicated web page.
EmailBundle API documentation.
Bundle installation
Step 1: Download the Bundle
Use Composer to install the library
Step 2: Enable the Bundle
Then, enable the bundle by adding it to the list of registered bundles in the app/AppKernel.php
file of your project:
Step 3: Configure the Bundle
Check dependencies for their configuration:
c975LEmailBundle uses c975L/ConfigBundle to manage configuration parameters. Use the Route "/email/config" with the proper user role to modify them.
If you are NOT using Messenger remember to disable the contents in config/packages/messenger.yaml or configure it properly.
Step 4: Enable the Routes
Then, enable the routes by adding them to the app/config/routing.yml
file of your project:
Step 4: Create MySql table
You can use php bin/console make:migration
to create the migration file as documented in Symfony's Doctrine docs OR use /Resources/sql/emails.sql
to create the tables emails
and emails_archives
. The DROP TABLE
are commented to avoid dropping by mistake. It will also create a stored procedure sp_EmailsArchive()
and an event e_monthly_archives
to archives emails older than 90 days. If you don't want to use this feature, just remove them.
Step 5: Create MySql table
Have a look at the following links if you wish to use Symfony Messenger to dispatch messages with Doctrine. If you want to use async you may also have a look at this answer on StackOverflow.
How to use
Create a Twig template i.e. templates/emails/description.html.twig
with this content:
Then in your Controller, add this code to create, insert in DB and send your email:
Email messages templates
If you wish to override/disable a block defined in the fullLayout.html.twig
template, create your templates/bundles/c975LEmailBundle/emails/layout.html.twig
and use the following code:
Have a look at templates/emails/fullLayout.html.twig
, to see all available blocks.
Footer template
You should override the template templates/emails/footer.html.twig
in your templates/bundles/c975LEmailBundle/emails/footer.html.twig
and indicate there all the data you need to display at the bottom of sent email.
Use of dashboard and display messages sent
You can see the emails sent via the dashboard.
For this, simply, create the following structure templates/bundles/c975LEmailBundle/
in your app and then duplicate the file layout.html.twig
in it, to override the existing Bundle files, then apply your needed changes.
In layout.html.twig
, it will mainly consist to extend your layout and define specific variables, i.e. :
If this project help you to reduce time to develop, you can sponsor me via the "Sponsor" button at the top :)
All versions of email-bundle with dependencies
c975l/config-bundle Version *
c975l/includelibrary-bundle Version *
c975l/services-bundle Version *
c975l/toolbar-bundle Version *
doctrine/doctrine-bundle Version *
doctrine/orm Version *
knplabs/knp-paginator-bundle Version *
symfony/form Version *
symfony/security-bundle Version *
symfony/twig-bundle Version *
symfony/mailer Version *
twig/cssinliner-extra Version *
twig/extra-bundle Version *
twig/intl-extra Version *