Download the PHP package tomazahlin/symfony-mailer-bundle without Composer

On this page you can find all versions of the php package tomazahlin/symfony-mailer-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package symfony-mailer-bundle

Symfony2 Mailer Bundle

Build Status

SensioLabsInsight

This is the explanation of how the bundle is structured and also an installation / example tutorial for the bundle.

Mailer bundle allows you to write very clean code when sending emails. By default it uses Swiftmailer, but if you want, you can override the complete mailer implementation and use some other mailer library. Emails can be forwarded (send) to Swiftmailer directly in the code where you require it, and also if you implement a queueable mailer, sending of the mails can be postponed until Symfony's kernel.terminate event, which is handled after the output is already sent to the user, so the user does not notice the delay of the mailing.

The code is coupled to the Symfony2 framework, as it is presented in the bundle. It might be decoupled later if needed or requested.

Installation

Use composer to require the bundle inside composer.json by running the command:

Enable the bundle in your AppKernel.php

Run tests

Usage

View a controller with examples here

The bundle provides you with the mailing service which gives you access to other services as well, because it uses composition. It exposes one service, so you only have to inject one dependency, preferably the MailingInterface, to keep things decoupled.

To define your service, you should inject the ahlin_mailer.mailing service:

Templates

To override anything in the bundle, you can of course use bundle inheritance, but for simplicity you can also override some classes by overriding some of the default parameters of the bundle. And to override templates you can define your custom templates in app/Resources.

The bundle is packaged with a default responsive html template:

- Resources/views/Mail/default.html.twig

You can easily replace the template, by defining your own in app/Resources folder or you can use bundle inheritance to do the same.

To define your own templates, the bundle uses Open for extension / closed for modification solid principle. To define your own templates, you need to create a class and tag it with "ahlin_mailer.mapping". Let's say you wanted to create a mapping for your UserBundle.

Create a class which implements TemplateMappingInterface.

As you can see, it is only a mapping between aliases and their paths, so when you need to specify which template you want to use, your code will be much shorter and cleaner. And the service definition for the container would look like this:

You can define (override) the parameters which are always passed to the email templates, by overriding the parameter:

In the twig template, you can access it with {{ myHomepageUrl }}.

For any questions or issues regarding this bundle, please do not hesitate to ask. Feel free to create your own forked version or submit any pull requests.

Version 2.2 allows you to add Filters, which modify the email's body. Some filters (if they maybe convert images from url to inline images) also can modify the Swift_Message model. All you have to do is to implement FilterInterface and tag the filter with "ahlin_mailer.filter".

Version 2.2 allows you to use the Mailer class to send Swfit_Message instances.


All versions of symfony-mailer-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
symfony/framework-bundle Version ~2.6
symfony/swiftmailer-bundle Version ~2.3
sensio/distribution-bundle Version >=4.0
sensio/framework-extra-bundle Version ~3.0,>=3.0.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tomazahlin/symfony-mailer-bundle contains the following files

Loading the files please wait ....