Appearance
Hooks
email_form_send_form_start
This hook is called right before the email template is parsed and sent. It receives the template variables (in a mailtype="html" email the submitted values are HTML-escaped) and the attachments ([field_name => path]), and must return the (modified) variables. (e.g. for in Postmaster)
It is not called when the email is stopped before that by to:field (no match and no to:email) or by allow_duplicate_email_address="no".
Added in 1.0
if (ee()->extensions->active_hook('email_form_send_form_start') === TRUE)
{
$variables = ee()->extensions->call('email_form_send_form_start', $variables, $attachments);
}email_form_send_form_end
This hook is called after the send step, with the same arguments as email_form_send_form_start. It is also called when no email was sent (send_email="no", a direct email that was already sent, or a failed send), but not in the two cases where email_form_send_form_start is not called. The return value is not used.
Added in 1.0
if (ee()->extensions->active_hook('email_form_send_form_end') === TRUE)
{
ee()->extensions->call('email_form_send_form_end', $variables, $attachments);
}email_form_form_start
This hook is called at the start of the {exp:reinos_email_form:form} tag. The return value is not used. It is not called when there is no encryption key.
Added in 1.2
if (ee()->extensions->active_hook('email_form_form_start') === TRUE)
{
ee()->extensions->call('email_form_form_start', '');
}email_form_form_end
This hook is called at the end of the {exp:reinos_email_form:form} tag. It receives the HTML of the form and must return it.
Added in 1.2
if (ee()->extensions->active_hook('email_form_form_end') === TRUE)
{
$return = ee()->extensions->call('email_form_form_end', $return);
}email_form_attachment
Assign extra files via an extension. It receives the submitted fields and the template variables. Make sure you return an array with full paths to the files; a path that is not an existing file is skipped.
It is only called when the email is sent (send_email="yes"). The extra files also count as attachments for queue.
Added in 1.8
if (ee()->extensions->active_hook('email_form_attachment') === TRUE)
{
$extra_files = ee()->extensions->call('email_form_attachment', $extra_fields, $variables);
}