Download the PHP package instaclick/base-mail-bundle without Composer
On this page you can find all versions of the php package instaclick/base-mail-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download instaclick/base-mail-bundle
More information about instaclick/base-mail-bundle
Files in instaclick/base-mail-bundle
Package base-mail-bundle
Short Description This Bundle provides mail support for Symfony2 applications
License MIT
Informations about the package base-mail-bundle
InstaClick Base Mail Bundle
Introduction
This bundle provides a lower level support for mail manipulation on Symfony2. It is supported to deal with composing, sending and dealing with bounced messages in an abstract API.
Installation
Installing this bundle can be done through these simple steps:
-
Add this bundle to your project as a composer dependency:
- Add this bundle in your application kernel:
Configuring the bundle
By default, any composed message contains a sender name and address. This simplifies the implementation time and cleaner code. You are allowed to change these values anytime, but if negative, you can globally configure this support.
To define the default sender name and address, do the following:
This bundle also comes with a bounced email handler. For any reasons, when
dealing with delivery of messages to users' mailbox, you also need to handle
possible failures that users may have done. The best example is mispelled email
addresses.
To configure the bounced email handler, configure the mail_bounce
section in
bundle's configuration:
Using available Services
The purpose of this bundle is to simplify mail creation, sending and handling possible failures. These three sections derived into three services that can be used by any application that consumes this bundle.
Composer Service
Responsible to compose messages. Configured default sender automatically
injects sender name and address to any message that gets created out of this
service. The methods setDefaultSenderName
and setDefaultSenderAddress
provide an ability to modify the values at runtime if necessary.
Apart from the before mentioned methods, this service only contains one method:
createMessage
; it initializes a new message to be prepared for sending.
A message instance contains a lot of options that can be defined by consuming
its API. By default, any message is configured to be a text/html
message and
the method setContentType
provides an ability to modify this behavior.
The interface for Message API is the following one:
Sender Service
After your message is composed, it is time to send it. Sender service provides
this support by exposing a public method called send
. This method returns a
boolean value in case of successful delivery or failure. It does not take into
consideration bounced mail, since this is an asynchronous action that must be
implemented by a consumer of BounceMail Service.
All versions of base-mail-bundle with dependencies
symfony/twig-bundle Version ~2.1
symfony/framework-bundle Version ~2.1
symfony/swiftmailer-bundle Version ~2.1
symfony/finder Version ~2.1