# double-opt-in/2.15/compatibility/avada/AvadaFormSubmit.class.php

Double Opt-In for Contact Form 7 – Secure, GDPR-Compliant Email Verification, version 2.15. 64 lines.

- Page: https://pluginprobe.com/plugins/double-opt-in/2.15/code/compatibility/avada/AvadaFormSubmit.class.php
- Raw: https://pluginprobe.com/plugins/double-opt-in/2.15/raw/compatibility/avada/AvadaFormSubmit.class.php
- Modified: 2022-12-16T11:04:54+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/double-opt-in/2.15/code/compatibility/avada/AvadaFormSubmit.class.php#L10-L20`.

```php
<?php

namespace forge12\contactform7\CF7DoubleOptIn {
    if (!defined('ABSPATH')) {
        exit;
    }

    if (class_exists('\Fusion_Form_Submit')) {
        /**
         * Class Frontend
         * Responsible to handle the frontend of the Double OptIn
         *
         * @package forge12\contactform7\CF7DoubleOptIn
         */
        class AvadaFormSubmit extends \Fusion_Form_Submit
        {
            /**
             * Proces nonce, recaptcha and similar checks.
             * Dies if checks fail.
             *
             * @access protected
             * @since 3.1.1
             * @return void
             */
            protected function pre_process_form_submit() {
                // Verify the form submission nonce.
                //check_ajax_referer( 'fusion_form_nonce', 'fusion_form_nonce' );

                // If we are in demo mode, just pretend it has sent.
                if ( apply_filters( 'fusion_form_demo_mode', false ) ) {
                    die( wp_json_encode( $this->get_results_from_message( 'success', 'demo' ) ) );
                }

                // Check reCAPTCHA response and die if error.
                $this->check_recaptcha_response();
            }

            /**
             * Ajax callback for 'send to email' submission type.
             *
             * @access public
             * @return void
             * @since 3.1
             */
            public function submit($formID, $sendmail_args)
            {
                $this->pre_process_form_submit();

                // Checks nonce, recaptcha and similar. Dies if checks fail.
                $data = $this->get_submit_data();

                $sendmail = $this->submit_form_to_email($data);

                if ($sendmail) {
                    $fusion_forms = new \Fusion_Form_DB_Forms();
                    $fusion_forms->increment_submissions_count($formID);

                    return true;
                }
                return false;
            }
        }
    }
}
```
