Download the PHP package kyoushu/inline-swiftmailer-transport without Composer
On this page you can find all versions of the php package kyoushu/inline-swiftmailer-transport. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kyoushu/inline-swiftmailer-transport
More information about kyoushu/inline-swiftmailer-transport
Files in kyoushu/inline-swiftmailer-transport
Package inline-swiftmailer-transport
Short Description A SwiftMailer transport which inlines CSS before forwarding the message to another transport for delivery
License MIT
Informations about the package inline-swiftmailer-transport
Kyoushu/InlineSwiftmailerTransport 
A SwiftMailer transport which inlines CSS before forwarding the message to another transport for delivery
Filters
Inline Embedded CSS
This filter is loaded automatically when an instance of InlineTransport is created
Example
$deliveryTransport = new \Swift_SmtpTransport('localhost', 25);
$transport = new InlineTransport($deliveryTransport, new \Swift_Events_SimpleEventDispatcher());
$message = new \Swift_Message('Foo', '<html><head><style>p{ font-weight: bold; }</style></head><body><p>Foo</p></body></html>', 'text/html');
$transport->send($message);
Body sent via delivery transport
<html><head><style>p{ font-weight: bold; }</style></head><body><p style="font-weight: bold;">Foo</p></body></html>
Inline Included CSS
If you want to inline CSS included with \<link> elements, rather than CSS which has been embedded with \<style> elements, use the InlineCssMessageFilter class.
Example
$webRootDir = '/path/to/my/web/root/dir';
$deliveryTransport = new \Swift_SmtpTransport('localhost', 25);
$transport = new InlineTransport($deliveryTransport, new \Swift_Events_SimpleEventDispatcher());
$transport->addMessageFilter(new InlineCssMessageFilter($webRootDir));
$message = new \Swift_Message('Foo', '<html><head><link rel="stylesheet" href="/css/email.css"></head><body><p>Foo</p></body></html>', 'text/html');
$transport->send($message);
Embed Images
Example
\<img> elements with absolute src attributes are embedded, and updated with "cid:########" values.
$webRootDir = '/path/to/my/web/root/dir';
$deliveryTransport = new \Swift_SmtpTransport('localhost', 25);
$transport = new InlineTransport($deliveryTransport, new \Swift_Events_SimpleEventDispatcher());
$transport->addMessageFilter(new EmbedImageMessageFilter($webRootDir));
$message = new \Swift_Message('Foo', '<html><body><img src="/images/my-image.png"</body></html>', 'text/html');
$transport->send($message);
Body sent via delivery transport
<html><body><img src="cid:09F48ag2b674"</body></html>
All versions of inline-swiftmailer-transport with dependencies
swiftmailer/swiftmailer Version ^5.4
tijsverkoyen/css-to-inline-styles Version ^1.5
symfony/dom-crawler Version ^3.0