Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/m-adamski/symfony-mailer-bundle

Bundle for Symfony which helps compose and send emails
https://github.com/m-adamski/symfony-mailer-bundle

mailer-bundle php symfony symfony-bundle

Last synced: 26 days ago
JSON representation

Bundle for Symfony which helps compose and send emails

Awesome Lists containing this project

README

        

# Mailer Bundle for Symfony

The package unifies the class nomenclature and adds new functionality to the existing SwiftMailer library.
Using it, creating messages is more convenient and faster.

This bundle is compatible with Symfony 4.1 and Symfony 5.0. Symfony 3.4 compatibility abandoned.

## Installation

This bundle can be installed by Composer:

```
$ composer require m-adamski/symfony-mailer-bundle
```

## How to use it?

The helper contains an additional function to create a message instance.
With its help, you can also render the message content from the Twig template.

| Method | Description |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| buildMessage | The function returns a message instance. It is possible to overwrite the class parameters later. |
| renderTemplate | The function renders the message content from the given Twig template. |
| sendMessage | The function sends a previously prepared message. The return value is the number of recipients to whom the message was sent. |

To simplify the creation of HTML messages, a function has been prepared in the ``MailerMessage`` class that automatically defines the message as ``text/html``.

| Method | Description |
| ----------- | ----------------------------------------------------------------- |
| setHTMLBody | The function sets the class parameters to get a text/html message |

## License

MIT