Function __global->form_to_email

Definitions

sources/mail_forms.php

  • Send the POSTed form over e-mail to the staff address.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$subject ?string No No Null N/A N/A The subject of the e-mail (null: from POSTed/tagged subject parameter)
$subject_prefix string No No Blank (empty string) N/A N/A The prefix text to the e-mail subject (blank: none)
$subject_suffix string No No Blank (empty string) N/A N/A The suffix text to the e-mail subject (blank: none)
$body_prefix string No No Blank (empty string) N/A N/A The prefix text to the e-mail body (blank: none)
$body_suffix string No No Blank (empty string) N/A N/A The suffix text to the e-mail body (blank: none)
$fields ?array No No Null N/A N/A A map of fields to field titles to transmit. (null: all POSTed fields, except subject and e-mail)
$to_email ?EMAIL No No Null N/A N/A E-mail address to send to (null: look from POST environment [if allowed] / staff address)
$is_via_post boolean No No True N/A N/A Whether $fields refers to some POSTed fields, as opposed to a direct field->value map

Preview

Code (PHP)

/**
 * Send the POSTed form over e-mail to the staff address.
 *
 * @param  ?string $subject The subject of the e-mail (null: from POSTed/tagged subject parameter)
 * @param  string $subject_prefix The prefix text to the e-mail subject (blank: none)
 * @param  string $subject_suffix The suffix text to the e-mail subject (blank: none)
 * @param  string $body_prefix The prefix text to the e-mail body (blank: none)
 * @param  string $body_suffix The suffix text to the e-mail body (blank: none)
 * @param  ?array $fields A map of fields to field titles to transmit. (null: all POSTed fields, except subject and e-mail)
 * @param  ?EMAIL $to_email E-mail address to send to (null: look from POST environment [if allowed] / staff address)
 * @param  boolean $is_via_post Whether $fields refers to some POSTed fields, as opposed to a direct field->value map
 */

function form_to_email(?string $subject = null, string $subject_prefix = '', string $subject_suffix = '', string $body_prefix = '', string $body_suffix = '', ?array $fields = null, ?string $to_email = null, bool $is_via_post = true)