Download the PHP package ttskch/twigged-swiftmessage-builder without Composer
On this page you can find all versions of the php package ttskch/twigged-swiftmessage-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ttskch/twigged-swiftmessage-builder
More information about ttskch/twigged-swiftmessage-builder
Files in ttskch/twigged-swiftmessage-builder
Package twigged-swiftmessage-builder
Short Description Twig templated Swift_Message builder service.
License MIT
Homepage https://github.com/ttskch/TwiggedSwiftMessageBuilder
Informations about the package twigged-swiftmessage-builder
TwiggedSwiftMessageBuilder
TwiggedSwiftMessageBuilder
class allows you following things:
- to create Twig templated Swift_Message
- to create inline styled html email from unstyled html and css strings
- to embed some image files into message body
Requirements
- PHP 5.3+
Getting started
First add this dependency into your composer.json
:
Then you can send Twig templated email as below:
In Twig template you can define many things by using {% block [field-name] %}{% endblock %}
.
These fields can be defined.
- from
- from_name
- to
- cc
- bcc
- reply_to
- subject
- body
Use variables in Twig template
Offcourse you can pass variables and use them in Twig template as below:
Use inline-styled html email
You can make inline-styled html from unstyled html and css strings. To allow recipients of your html email to receive it with Gmail, you will have to make inline-styled html body.
Note
This functionality is using
mb_convert_encoding()
with'auto'
internally. So if you use this you must setmbstring.language
in php.ini or callmb_language('your_language')
on ahead.注意
この機能は内部的に
mb_convert_encoding()
に'auto'
を渡して実行します。なので、php.ini でmbstring.language
を設定するか、mb_language('Japanese')
を事前に実行しておく必要があります。
Embed some image files into message body
You can embed images into message body as below:
Enjoy!
See also functional tests to understand basic usages.
All versions of twigged-swiftmessage-builder with dependencies
swiftmailer/swiftmailer Version 5.2.1
twig/twig Version ~1.12
tijsverkoyen/css-to-inline-styles Version ~1.5