Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eschmar/mailer-bundle
Conveniently send html/plaintext emails in Symfony.
https://github.com/eschmar/mailer-bundle
mailer symfony symfony-bundle twig
Last synced: about 1 month ago
JSON representation
Conveniently send html/plaintext emails in Symfony.
- Host: GitHub
- URL: https://github.com/eschmar/mailer-bundle
- Owner: eschmar
- License: mit
- Created: 2015-03-24T10:25:14.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-10-17T20:19:45.000Z (over 6 years ago)
- Last Synced: 2024-11-14T19:23:19.096Z (2 months ago)
- Topics: mailer, symfony, symfony-bundle, twig
- Language: HTML
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mailer Bundle
Conveniently send html/plaintext emails in Symfony4. This bundle ships with a version of [Mailgun's Action Email](https://github.com/mailgun/transactional-email-templates) ready to send emails.![test.html.twig](https://raw.githubusercontent.com/eschmar/mailer-bundle/master/test.html.twig.jpg)
# Installation
Composer (Packagist):
```sh
composer require eschmar/mailer-bundle ^1.0.0
```# Usage
The ``eschmar_mailer`` service expects templates to have the 3 blocks ``subject``, ``body_html`` and ``body_plain`` and already includes a layout file ``@EschmarMailer/Mail/layout.html.twig`` ready to go. I do not recommend using embedded base64 images, this is just for demo purposes. Of course this layout is entirely optional, you may build your own templates. Using the Twig tag ``{% cssinline %}{% endcssinline %}``, CSS styles are inlined (some email clients strip out ```` and ```` tags).````php
use Eschmar\MailerBundle\Service\Mailer;
// ...if (!$mailer->send("@EschmarMailer/Mail/test.html.twig", [], $from, $to[, $bcc])) {
// Oops!
return;
}// success
````# License
MIT License.