class HtmlComposer

Composes HTML email body for a Message: optionally inlines CSS, embeds local images, extracts subject from , sets the HTML body, and generates a plain-text alternative.</p></p> </div> <h2>Methods</h2> <div class="container-fluid underlined"> <div class="row"> <div class="col-md-2 type"> </div> <div class="col-md-8"> <a href="#method___construct">__construct</a>(string $html) <p class="no-description">No description</p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Nette/Mail/HtmlComposer.html"><abbr title="Nette\Mail\HtmlComposer">HtmlComposer</abbr></a> </div> <div class="col-md-8"> <a href="#method_embedImages">embedImages</a>(string $basePath) <p><p>Enables embedding of local images referenced in HTML. The path is the base directory for resolving relative image references in <img src>, <body background>, url(...) in style attributes/<style> tags, and the [[file]] placeholder.</p></p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> <a href="../../Nette/Mail/HtmlComposer.html"><abbr title="Nette\Mail\HtmlComposer">HtmlComposer</abbr></a> </div> <div class="col-md-8"> <a href="#method_inlineCss">inlineCss</a>(string|null $css = null) <p><p>Enables CSS inlining. Without an argument only inlines <style> tags from HTML.</p></p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> void </div> <div class="col-md-8"> <a href="#method_applyTo">applyTo</a>(<a href="../../Nette/Mail/Message.html"><abbr title="Nette\Mail\Message">Message</abbr></a> $mail) <p><p>Applies the configured pipeline to the message: inlines CSS, embeds images, extracts subject from <title> (if not already set), sets the HTML body, and generates a plain-text alternative (if body is not already set).</p></p> </div> <div class="col-md-2"></div> </div> <div class="row"> <div class="col-md-2 type"> static string </div> <div class="col-md-8"> <a href="#method_htmlToText">htmlToText</a>(string $html) <p><p>Converts HTML to a plain-text alternative suitable for an email body.</p></p> </div> <div class="col-md-2"></div> </div> </div> <h2>Details</h2> <div id="method-details"> <div class="method-item"> <h3 id="method___construct"> <div class="location">at line 25</div> <code> <strong>__construct</strong>(string $html) </code> </h3> <div class="details"> <div class="method-description"> <p class="no-description">No description</p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$html</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_embedImages"> <div class="location">at line 36</div> <code> <a href="../../Nette/Mail/HtmlComposer.html"><abbr title="Nette\Mail\HtmlComposer">HtmlComposer</abbr></a> <strong>embedImages</strong>(string $basePath) </code> </h3> <div class="details"> <div class="method-description"> <p><p>Enables embedding of local images referenced in HTML. The path is the base directory for resolving relative image references in <img src>, <body background>, url(...) in style attributes/<style> tags, and the [[file]] placeholder.</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$basePath</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Nette/Mail/HtmlComposer.html"><abbr title="Nette\Mail\HtmlComposer">HtmlComposer</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_inlineCss"> <div class="location">at line 47</div> <code> <a href="../../Nette/Mail/HtmlComposer.html"><abbr title="Nette\Mail\HtmlComposer">HtmlComposer</abbr></a> <strong>inlineCss</strong>(string|null $css = null) </code> </h3> <div class="details"> <div class="method-description"> <p><p>Enables CSS inlining. Without an argument only inlines <style> tags from HTML.</p></p> <p><p>Can be called multiple times to append additional stylesheets.</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string|null</td> <td>$css</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td><a href="../../Nette/Mail/HtmlComposer.html"><abbr title="Nette\Mail\HtmlComposer">HtmlComposer</abbr></a></td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_applyTo"> <div class="location">at line 62</div> <code> void <strong>applyTo</strong>(<a href="../../Nette/Mail/Message.html"><abbr title="Nette\Mail\Message">Message</abbr></a> $mail) </code> </h3> <div class="details"> <div class="method-description"> <p><p>Applies the configured pipeline to the message: inlines CSS, embeds images, extracts subject from <title> (if not already set), sets the HTML body, and generates a plain-text alternative (if body is not already set).</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td><a href="../../Nette/Mail/Message.html"><abbr title="Nette\Mail\Message">Message</abbr></a></td> <td>$mail</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>void</td> <td></td> </tr> </table> </div> </div> </div> <div class="method-item"> <h3 id="method_htmlToText"> <div class="location">at line 91</div> <code> static string <strong>htmlToText</strong>(string $html) </code> </h3> <div class="details"> <div class="method-description"> <p><p>Converts HTML to a plain-text alternative suitable for an email body.</p></p> </div> <div class="tags"> <h4>Parameters</h4> <table class="table table-condensed"> <tr> <td>string</td> <td>$html</td> <td></td> </tr> </table> <h4>Return Value</h4> <table class="table table-condensed"> <tr> <td>string</td> <td></td> </tr> </table> </div> </div> </div> </div> </div><div id="footer"></div></div> </div> </body> </html>