# contact-forms/2.3.0/classes/Element/Email.php

Contact Forms by Cimatti, version 2.3.0. 23 lines.

- Page: https://pluginprobe.com/plugins/contact-forms/2.3.0/code/classes/Element/Email.php
- Raw: https://pluginprobe.com/plugins/contact-forms/2.3.0/raw/classes/Element/Email.php
- Modified: 2026-04-08T09:49:58+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/contact-forms/2.3.0/code/classes/Element/Email.php#L10-L20`.

```php
<?php
class AccuaForm_Element_Email extends Element_Textbox {
  public function __construct($label, $name, ?array $properties = null) {
    // Extract custom format message before parent constructor
    $custom_format_message = '';
    if (isset($properties['custom_format_message'])) {
      $custom_format_message = $properties['custom_format_message'];
      unset($properties['custom_format_message']);
    }

    parent::__construct($label,$name,$properties);
	  $this->attributes['type'] = 'email';

    if ($custom_format_message !== '') {
      $email_error_msg = str_replace(array('%s', '%element%'), $label, $custom_format_message);
    } else {
		  // translators: %element% is the field label.
		  $email_error_msg = str_replace('%element%', $label, __( "Attention: '%element%' must contain an email address.", 'contact-forms' ));
    }
		$this->setValidation(new Validation_Email($email_error_msg));
  }
}

```
