Form Builder: Email

Handles the emailing of Inputfields for FormBuilderProcessor

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the FormBuilderEmail class also inherits all the methods and properties of: FormBuilderData.

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
FormBuilderEmail::addFileAttachment($filename)
bool

Add a file attachment to the email (if supposed by the WireMail type being used)

 
FormBuilderEmail::emailsToArray(string $str)
array

Takes a string of email addresses (one per line), optionally including conditions, and convert them to an array of email addresses

 
FormBuilderEmail::getRawFormData()
array

Get raw form data as associative array

 
FormBuilderEmail::getWireMail()
WireMail

Get WireMail instance that will be used for sending

 
FormBuilderEmail::send()
bool int

Send the email

 
FormBuilderEmail::setAllowSubjectPlaceholders(bool $allow)
None

Allow placeholder {tags} in email subject? (default is false)

 
FormBuilderEmail::setLabels(array $labels)
None

Add additional labels to appear in email, indexed by field/property name

 
FormBuilderEmail::setMailer(string $mailerName)
None

Set name of mailer (WireMail) module to use, or use 'WireMail' for native PHP mail() or blank for auto-detect

 
FormBuilderEmail::setRawFormData(array $data)
None

Set raw form data from associative array

 
FormBuilderEmail::setSkipFieldName(string $fieldName)
$this

Set a field name that should be skipped in this email

 
FormBuilderEmail::setSkipFieldType(string $fieldType)
$this

Set a field type where all fields of the type should be skipped in this email

 
FormBuilderEmail::setTemplateVar(string $name, mixed $value)
$this

Set a variable to be provided to the rendering template

 
FormBuilderEmail::setValues(array $values)
None

Add additional values to appear in email, indexed by field/property name

 
FormBuilderEmail::setWireMail(WireMail $wireMail)
None

Set WireMail instance to use

 

Properties

NameReturnSummary 
FormBuilderEmail::body string Body of email (HTML) 
FormBuilderEmail::from string Email address from 
FormBuilderEmail::fromName string Name from  
FormBuilderEmail::replyTo string Reply to email address 
FormBuilderEmail::subject string Subject of email 
FormBuilderEmail::to string Email address to 

Additional methods and properties

In addition to the methods and properties above, FormBuilderEmail also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.252