Email Form Plugin

After the form is submitted, you can add a plugin to send some data to one or more email addresses.

All you need is to enter at least one Recipient email.

Sender email and Sender name are optional and this data will be taken from the global email settings from Brixy Configuration, but if necessary others can be entered for each specific form to which the email sending plugin has been added.

The email can be sent when the form is added, edited, or both. Email sending can be better controlled by optional php code written in the Condition to send code area.
The email content can be plain text (returned from the Email message code area) or full html code from some custom Template.

Template file can be php or html format. Each template file should be in a folder located in /brixy/Plugins/form/email/Templates/. Templates can be divided into folders based on when code is executed or associated with form names. Example: on_Before_Delete_Form, on_Before_Load...

Templates will be separated by folders in the dropdown menu automatically. If none is selected, ONLY the default plain text message returned from the Email message code area will be used.

The content of the template can be attached to the email content as a PDF or some files from your server.

To access all form elements data in Email message code area or in Template you need to use array $els_ro_data.

Iterate this array to get Each element data:

foreach($els_ro_data as $el){
	$id			= $el['id'];
	$label 		= $el['label'];	
	$value 		= $el['value'];	
	$value_raw  = $el['value_raw'];
	$name		= $el['name'];
	$group_id	= $el['group_id'];
}

Can use standard placeholders for Logged in User Data:

$user_groups = '{user_groups}';
$user_id = '{user_id}';
$user_name = '{name}';
$email = '{email}';
$lang_id = '{lang_id}';

$debug_user = [
    'user_groups' => $user_groups,
    'user_id'   => $user_id,
    'user_name' => $user_name,
    'email'     => $email,
    '$lang_id'  => $lang_id,
];
//p($debug_user);

To get a group name or some other group data if needed:

$groups_data = $this->Form_Model->getGroupsData();
$groups = $this->Form_Model->getGroups();

$origData = $this->Form_Model->getOrigData();

$debug_data = [
	'groups_data'   => $groups_data,
  'groups'      => $groups,
   'origData'       => $origData,
];
p($debug_data);