- The wp_mail() function is working. Tested with (my smtp plugin|a custom function) and i'm sure i can deliver a email messages
- The page and form have well formed html, even the form is set up with the correct "to:" and "from:" and no warnings in the cf7 backend.
- I have disabled plugins that are not necessary for my site (if there are some you just can't disable list here)
- I have disabled all the caching plugins (mandatory)
- Tried to switch theme without success. (if you can't or with the default template cf7 works, you need to check your template functions that hooks to wpcf7 or wp_mail). Activating wp_debug will help you to deal with this
- cf7 works in [ajax mode](https://contactform7.com/why-isnt-my-ajax-contact-form-working-corr
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* inspired from https://github.com/Yoast/wpseo-woocommerce/blob/trunk/js/src/yoastseo-woo-replacevars.js */ | |
| /* global jQuery, YoastSEO, app, globals YoastACFAnalysisConfig */ | |
| var pluginName = "additionalVariablePlugin"; | |
| var ReplaceVar = window.YoastReplaceVarPlugin && window.YoastReplaceVarPlugin.ReplaceVar; | |
| var placeholders = {}; | |
| var modifiableFields = [ | |
| "content", | |
| "title", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| if ( !get_transient( 'wpcf7_test_mail' ) ) { | |
| set_transient( 'wpcf7_test_mail', 'sent', 600 ); // no more than 1 mail every 10 Minutes | |
| add_action( 'wp_footer', 'send_test_mail' ); // execute my function on the desired hook. | |
| add_action( 'phpmailer_init', 'phpmailer_conf' ); // tests the php mailer (not needed) | |
| } | |
| function send_test_mail() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var delay = 2000; // set the preferred delay before send email | |
| var interval = null; // don't touch this | |
| jQuery(function ($) { | |
| // displays the button in active state | |
| function sendDisplayON(btn) { | |
| btn.val('Abort?'); | |
| btn.addClass('submitting'); | |
| $(btn).siblings('.ajax-loader').css('visibility','visible'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Returns an array of product ids similar to the given sku / gtin | |
| * @param $sku - the search key | |
| * @param int $limit - maximum number of returned items | |
| * | |
| * @return array|bool | |
| */ | |
| function prefix_get_product_arr_by_sku( $sku, $limit = 10 ) { | |
| global $wpdb; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function prefix_replace_email( $posted_data ) { | |
| $posted_data[ 'your-email-backup' ] = $posted_data[ 'your-email' ] ; | |
| $posted_data[ 'your-email' ] = str_replace('@', 'A', $posted_data[ 'your-email' ]) . '@mysupport.com' ; | |
| return $posted_data; | |
| } | |
| add_filter( 'wpcf7_posted_data', 'prefix_replace_email' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * wc_direct_link_to_product_tabs | |
| * | |
| * Allows you to create custom URLs to activate product tabs by default, directly from the URL. | |
| * ex: http://mysite.com/my-product-name#reviews | |
| * this fork add history.pushState and each tab will be treated as a page | |
| * so you can use browser history back / forward to move along tabs | |
| */ | |
| add_action( 'wp_footer', function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // the default palette | |
| $wpcf7-white: #fff !default; // Blue | |
| $wpcf7-light-gray: #505b66 !default; // Light Gray | |
| $wpcf7-dark-gray: #23282d !default; // Dark Gray | |
| $wpcf7-blue: #00a0d2 !default; // Blue | |
| $wpcf7-green: #46b450 !default; // Green | |
| $wpcf7-red: #dc3232 !default; // Red | |
| $wpcf7-orange: #f56e28 !default; // Orange | |
| $wpcf7-yellow: #ffb900 !default; // Yellow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Dequeue global wordpress style | |
| */ | |
| if ( ! function_exists( 'my_remove_global_style' ) ) : | |
| function my_remove_global_style() { | |
| wp_deregister_style( 'global-styles' ); | |
| wp_dequeue_style( 'global-styles' ); | |
| } | |
| endif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // a modified version of https://stackoverflow.com/a/33748742/5735847 | |
| function get_accept_language_array( $languages ) { | |
| return array_values( | |
| array_reduce( | |
| explode(',', str_replace(' ', '', $languages) ), | |
| function ($res, $el) { | |
| if (strlen($el) === 5) { | |
| $l = explode('-', $el); |