Email_Notifications::get_meta_fields()

Returns the available meta fields for the submodule.

Description

Return

(array) Associative array of <code>$field_slug => $field_args</code> pairs.

Source

File: src/modules/actions/email-notifications.php

	public function get_meta_fields() {
		$meta_fields = $this->_get_meta_fields();

		unset( $meta_fields['enabled'] );

		$domain = wp_parse_url( home_url( '/' ), PHP_URL_HOST );
		if ( ! $domain ) {
			// Fall back to a random domain.
			$domain = 'yourwebsite.com';
		}

		$meta_fields['notifications'] = array(
			'type'        => 'group',
			'label'       => __( 'Notifications', 'torro-forms' ),
			// 'description' => __( 'Add email notifications to send.', 'torro-forms' ),
			'repeatable'  => 8,
			'fields'      => array(
				'from_name'   => array(
					'type'                 => 'templatetagtext',
					'label'                => __( 'From Name', 'torro-forms' ),
					'input_classes'        => array( 'regular-text' ),
					'template_tag_handler' => $this->template_tag_handler,
				),
				'from_email'  => array(
					'type'                 => 'templatetagemail',
					'label'                => __( 'From Email', 'torro-forms' ),
					/* translators: %s: email address */
					'description'          => sprintf( __( 'This email address should contain the same domain like your website (e.g. %s).', 'torro-forms' ), 'email@' . $domain ),
					'input_classes'        => array( 'regular-text' ),
					'template_tag_handler' => $this->template_tag_handler_email_only,
				),
				'reply_email' => array(
					'type'                 => 'templatetagemail',
					'label'                => __( 'Reply Email', 'torro-forms' ),
					'input_classes'        => array( 'regular-text' ),
					'template_tag_handler' => $this->template_tag_handler_email_only,
				),
				'to_email'    => array(
					'type'                 => 'templatetagemail',
					'label'                => __( 'To Email', 'torro-forms' ),
					'input_classes'        => array( 'regular-text' ),
					'template_tag_handler' => $this->template_tag_handler_email_only,
				),
				'cc_email'    => array(
					'type'                 => 'templatetagemail',
					'label'                => _x( 'Cc', 'email', 'torro-forms' ),
					'input_classes'        => array( 'regular-text' ),
					'template_tag_handler' => $this->template_tag_handler_email_only,
				),
				'bcc_email'   => array(
					'type'                 => 'templatetagemail',
					'label'                => _x( 'Bcc', 'email', 'torro-forms' ),
					'input_classes'        => array( 'regular-text' ),
					'template_tag_handler' => $this->template_tag_handler_email_only,
				),
				'subject'     => array(
					'type'                 => 'templatetagtext',
					'label'                => __( 'Subject', 'torro-forms' ),
					'input_classes'        => array( 'regular-text' ),
					'template_tag_handler' => $this->template_tag_handler,
				),
				'message'     => array(
					'type'                 => 'templatetagwysiwyg',
					'label'                => __( 'Message', 'torro-forms' ),
					'media_buttons'        => true,
					'template_tag_handler' => $this->template_tag_handler_complex,
				),
			),
		);

		return $meta_fields;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.