Class · extends AbstractModel
Functionality related to mail templates.
Emails sent by WHMCS are composed by Smarty templates stored in the database.
This object allows one to interact with an outgoing mail template. You can interact with the template's contents, edit the subject line, change it's type, or change it's name. Templates are identified in the product by their Unique ID or the type:name pair.
A disabled template specified for an outgoing email message will cause template processing to fail, and cause the email to not be sent.
| Type | Name | Description |
|---|---|---|
| `` | $unique | |
| `` | $temporaryAttachments | This is not stored in DB, and is used to transmit information about mass mail attachments that are stored separately from template attachments |
public function __toString()Represent a mail template by its name.
public function scopeMaster($query)Retrieve "master" mail templates.
A master mail template is a mail template with no defined language.
Parameters
| Type | Name | Description |
|---|---|---|
Builder | $query |
Returns Builder
public function scopeDomain($query)public function scopeName(Builder $query, string $name)public static function getActiveLanguages()Retrieve a list of all of the languages used by all mail templates.
Returns \Illuminate\Database\Eloquent\Collection
public static function boot()public function toArray(): arraypublic static function factoryFromArray(array $templateData): Template