Noptin_Ninja_Forms::process( array $action_settings, int $form_id, array $data )

Process the action


Parameters Parameters

$action_settings

(array) (Required)

$form_id

(int) (Required)

$data

(array) (Required)


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/integrations/class-noptin-ninja-forms.php

	public function process( $action_settings, $form_id, $data ) {

		// All subscribers need an email address.
		if ( ! is_email( $action_settings['noptin_email'] ) )  {
			return $data;
		}

		// Abort if marketing consent was not given.
		if ( ! empty( $action_settings['noptin_GDPR_consent'] ) && __( 'Unchecked', 'newsletter-optin-box' ) === $action_settings['noptin_GDPR_consent'] )  {
			return $data;
		}
		
		// Prepare Noptin Fields.
		$noptin_fields = $this->map_fields( $action_settings );

		// Add integration data.
		$noptin_fields['integration_data'] = compact( 'action_settings', 'data', 'form_id' );

		// Filter the subscriber fields.
		$noptin_fields = apply_filters( 'noptin_ninja_forms_integration_new_subscriber_fields', $noptin_fields );

		// Register the subscriber.
		add_noptin_subscriber( $noptin_fields );

		// Return subscriber data.
		return $data;
	}


Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation