The Notification object contains the settings for the administrator’s notification, such as destination email address, email subject and body. It is defined as an associative array. For more details on managing your notifications, see the Notifications page.
$form["notification"]["bcc"]; //returns the BCC email address $form["notification"]["subject"]; //returns the email subject
- to string
Contains the notification destination email address(es). For multiple emails, separate them with a comma (,) (i.e. firstname.lastname@example.org, email@example.com).
If specified, forces the email to be sent from this address. If not specified, the email address configured in WordPress will be used.
Id of an email field on the form whose value should be used as the from address.
Contains the email address to be used as the reply to email address.
Id of an email field on the form whose value should be used as the reply to email address.
Contains the email address to be used as the bcc email address.
Contains the subject of the email.
Contains the body/content of the email.
Determines if the email message should be formatted so that paragraphs are automatically added for new lines. 1 disables auto-formatting, 0 enables auto-formatting.
Allows notifications to be routed to different email addresses based on field values entered on the form. This array contains multiple routing rules. Each rule is evaluated separately and the notification will be sent to all rules that match.
$form["notification"]["routing"]["email"]; //returns the email of the first routing rule
Following are the properties or each routing rule
- fieldId integer
Target field Id. Field that will have it’s value compared with the value property to determine if this rule is a match
Operator to be used when evaluating this rule.
Possible values: is, isnot
- is: Evaluates this rule to true when the value property is equal to the value of field specified by fieldId.
- isnot: Evaluates this rule to true when the value property is not equal to the value of field specified by fieldId.
- value string
The value to compare with the field specified by fieldId
- fieldId integer