diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-11-25 07:50:30 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-11-25 07:50:30 +0000 |
commit | 907ce8c044159ca8da6ccce3ec5362ac61e7c142 (patch) | |
tree | 4e4b83a3aa041a1826e4ac876b001195fce3f7c2 /Postman/Postman-Mail/PostmanContactForm7.php | |
parent | a41b9219a66f4018dc581f561fbe3fedd24e73f2 (diff) | |
download | Post-SMTP-907ce8c044159ca8da6ccce3ec5362ac61e7c142.zip |
deleted by mistake
Diffstat (limited to 'Postman/Postman-Mail/PostmanContactForm7.php')
-rw-r--r-- | Postman/Postman-Mail/PostmanContactForm7.php | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/Postman/Postman-Mail/PostmanContactForm7.php b/Postman/Postman-Mail/PostmanContactForm7.php deleted file mode 100644 index 8792b08..0000000 --- a/Postman/Postman-Mail/PostmanContactForm7.php +++ /dev/null @@ -1,42 +0,0 @@ -<?php -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly -} -class Postsmtp_ContactForm7 { - - private $result_error; - - public function __construct() { - add_action( 'wpcf7_mail_failed', array( $this, 'save_error' ) ); - add_filter( 'wpcf7_ajax_json_echo', array( $this, 'change_rest_response' ), 10, 2 ); - } - - public function save_error($contact_form) { - $this->result_error = apply_filters( 'postman_wp_mail_result', null ); - } - - public function change_rest_response( $response ) { - if ( array_key_exists('status', $response) && $response['status'] == 'mail_failed' ) { - $message = $this->result_error ['exception']->getMessage(); - - if ( ! $message || $message == '' ) { - return $response; - } - - $currentTransport = PostmanOptions::getInstance()->getTransportType(); - $result = json_decode($message); - $is_json = (json_last_error() == JSON_ERROR_NONE); - - switch ($currentTransport) { - case 'gmail_api': - $response['message'] = $is_json ? $result->error->message : $message; - break; - default: - $response['message'] = $is_json ? json_encode(json_decode($message), JSON_PRETTY_PRINT) : $message; - } - } - - return $response; - } - -} |