Email_Notifications::enabled( awsmug\Torro_Forms\DB_Objects\Forms\Form $form )

Checks whether the access control is enabled for a specific form.

Description

Parameters

$form

(awsmug\Torro_Forms\DB_Objects\Forms\Form) (Required) Form object to check.

Return

(bool) True if the access control is enabled, false otherwise.

Source

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

	public function enabled( $form ) {
		$notifications = $this->get_form_option( $form->id, 'notifications', array() );

		$notifications = array_filter( $notifications, function( $notification ) {
			return ! empty( $notification['to_email'] ) && ! empty( $notification['subject'] ) && ! empty( $notification['message'] );
		});

		if ( ! empty( $notifications ) ) {
			return true;
		}

		return false;
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.