-
Notifications
You must be signed in to change notification settings - Fork 0
Classes \Postman\Emails\View
The \Postman\Library\Email\View
object is intended to mimic CakePHP's own EmailComponent
by utilizing the View
object for rendering both the HTML and text body for the email.
One notable difference between the EmailComponent
is that this object will attempt to render both HTML and text depending on what the Transport
object that consumes it requests.
This method sets the template to use when rendering.
This method sets the layout to use when rendering.
This method sets the object to use when rendering.
Similar to how one sets values in a controller, this sets values that will be used when rendering a view.
If the $key
parameter is an array all values will be added.
Other versions of the Email
object expose a __call
method which grants read access to their member variables. This is commonly used by Transport
objects to inspect certain attributes of the Email
. To accommodate for the automatic rendering, this class overrides getHtmlBody
and getTextBody
. Calls to these methods may be more computationally expensive since a View
object must be created each time.