conditional-email-routing-for-contact-form-7
Last commit date
assets
1 month ago
includes
1 month ago
languages
1 year ago
LICENSE.txt
1 year ago
conditional-email-routing-for-cf7.php
1 month ago
index.php
1 year ago
readme.txt
1 month ago
conditional-email-routing-for-cf7.php
49 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Plugin Name: MailRoute - Conditional Email Routing For Contact Form 7 |
| 4 | * Requires Plugins: contact-form-7 |
| 5 | * Description: Routes email to different recipients based on form field values. |
| 6 | * Version: 1.4.2 |
| 7 | * Requires at least: 5.2 |
| 8 | * Requires PHP: 7.2 |
| 9 | * Author: atplugins |
| 10 | * Author URI: https://atplugins.com/ |
| 11 | * License: GPL-2.0+ |
| 12 | * License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 13 | * Text Domain: conditional-email-routing-for-contact-form-7 |
| 14 | * Domain Path: /languages |
| 15 | */ |
| 16 | |
| 17 | if ( ! defined( 'ABSPATH' ) ) { |
| 18 | exit; // Exit if accessed directly. |
| 19 | } |
| 20 | |
| 21 | define( 'CERCF7_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 22 | define( 'CERCF7_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 23 | |
| 24 | /** |
| 25 | * Load plugin text domain for translations |
| 26 | */ |
| 27 | add_action( 'plugins_loaded', 'cercf7_load_textdomain' ); |
| 28 | function cercf7_load_textdomain(){ |
| 29 | load_plugin_textdomain( 'conditional-email-routing-for-contact-form-7', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Check if Contact Form 7 is active |
| 34 | */ |
| 35 | function cercf7_check_dependencies() { |
| 36 | if ( defined( 'WPCF7_PLUGIN' ) ) { |
| 37 | include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 38 | |
| 39 | if ( !is_plugin_active( 'conditional-email-routing-for-cf7-pro/conditional-email-routing-for-cf7-pro.php' ) ) { |
| 40 | // The pro version is not active |
| 41 | require_once CERCF7_PLUGIN_DIR . 'includes/class-cercf7-conditional-routing.php'; |
| 42 | CERCF7_Conditional_Email_Routing::get_instance(); |
| 43 | |
| 44 | require_once CERCF7_PLUGIN_DIR . 'includes/cercf7-conditional-mail2-demo.php'; |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | add_action( 'plugins_loaded', 'cercf7_check_dependencies' ); |
| 49 |