Download the PHP package tobento/service-mail without Composer
On this page you can find all versions of the php package tobento/service-mail. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package service-mail
Mail Service
Mailer interface for PHP applications using the Symfony Mailer as default mailer implementation.
Table of Contents
- Getting started
- Requirements
- Highlights
- Documentation
- Basic Usage
- Creating And Sending Messages
- Message
- Email Addresses
- Contents
- Headers
- File Attachments
- Tags And Metadata
- Queue
- Send With Mailer
- Custom Parameters
- Mailer
- Null Mailer
- SF Mailer
- Mailers
- Default Mailers
- Lazy Mailers
- Templating
- Writing Views
- Render Templates
- Events
- Symfony
- Symfony Mailer
- Events Support
- Queue Support
- Default Addresses And Parameters
- Html To Text Converting
- Symfony Dsn Mailer Factory
- Symfony Smtp Mailer Factory
- Symfony Custom Parameters Support
- Symfony Mailer
- Basic Usage
- Credits
Getting started
Add the latest version of the mail service project running this command.
Requirements
- PHP 8.0 or greater
Highlights
- Framework-agnostic, will work with any project
- Decoupled design
Documentation
Basic Usage
Creating And Sending Messages
Check out the available Mailers.
Check out the Message to learn more about it.
Message
Email Addresses
Contents
Headers
File Attachments
Tags And Metadata
Queue
You may queue your message if your mailer is configured to support it.
Check out the Symfony Mailer - Queue Support for support.
Send With Mailer
You may define a mailer used to send the message if your mailer supports it.
Check out the Mailers for more detail.
Custom Parameters
You may write your own parameters in the following way:
Check out the Symfony Custom Parameters Support for handling your custom parameter.
Mailer
Null Mailer
The does not send any mail message at all which may be useful while developing (or testing).
SF Mailer
Documentation is in the Symfony Mailer section.
Mailers
You may use the following mailers as your MailerInterface implementation for supporting the Send With Mailer parameter.
Default Mailers
Lazy Mailers
The lazy mailers class creates the mailer only on demand.
Templating
The following examples are aimed for the default renderer .
Writing Views
The welcome view template
A variable called message, which is an instance of is available on every view.
Furthermore, use css file assests to design your template. When the template gets rendered, it will convert them to inline styles for better email clients support.
Render Templates
You may want to render a template for an email web view, debugging or other purposes.
Events
You may listen to the following events if your mailer is configured to support it.
Event | Description |
---|---|
The Event will be fired after sending the message. | |
The Event is fired if the message could not be sent. | |
The Event will be fired after queuing the message. |
Check out the Symfony Mailer - Events Support to create the mailer supporting events.
Symfony
Symfony Mailer
Check out the View Service to learn more about it.
Events Support
In order to support events you will need to pass a dispatcher to the mailer:
Queue Support
In order to support queuing messages you will need to pass a queue handler to the mailer.
Consider using the default queue handler using the Queue Service:
First, install the queue service:
Next, pass the queue handler to the mailer:
Finally, make sure the container of the job processor has the following interfaces available:
Example using the Service Container as container:
Default Addresses And Parameters
You may set default addresses and/or parameters to be applied to every message:
Html To Text Converting
If you create a message without text content, it will be created from your html content.
Symfony Dsn Mailer Factory
Symfony Smtp Mailer Factory
Symfony Custom Parameters Support
In order to support your custom parameters you could write a new email factory class or extend the default:
Credits
- Tobias Strub
- All Contributors
- Symfony Mailer
All versions of service-mail with dependencies
tobento/service-view Version ^1.0.7
tobento/service-filesystem Version ^1.0.5
tobento/service-autowire Version ^1.0
symfony/mailer Version ^6.0
tijsverkoyen/css-to-inline-styles Version ^2.2.5
psr/container Version ^2.0
psr/http-message Version ^1.0
psr/event-dispatcher Version ^1.0