Skip to content

Commit

Permalink
Merge pull request #122 from mailjet/feature/27737_Wordpress_v4_Add_p…
Browse files Browse the repository at this point in the history
…roxy_support

#27737  Feature/27737 wordpress v4 add proxy support
  • Loading branch information
Ferhan Ismailov authored Dec 6, 2018
2 parents e26b15d + b6398c8 commit 993ce05
Show file tree
Hide file tree
Showing 27 changed files with 753 additions and 133 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Contributors: mailjet
Tags: email, marketing, signup, newsletter, widget, smtp, mailjet
Requires at least: 3.3.0
Tested up to: 4.9
Stable tag: 4.3.0
Stable tag: 4.4.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -114,6 +114,9 @@ function getMailjetSubscriptionEmailTemplate($templatePath) {

== Changelog ==

= 4.4.0 =
* Add proxy support

= 4.3.0 =
* Update the confirmation email template for English, French, German and Spanish
* Add new filter 'mailjet_subscription_widget_email_params' that enable the users to replace the email confirmation message parameters
Expand Down
11 changes: 10 additions & 1 deletion api/mailjet-api-v1.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,16 @@ public function sendRequest($method = false, $params = array(), $request = 'GET'
curl_setopt($curl_handle, CURLOPT_USERPWD, $this->apiKey . ':' . $this->secretKey);
curl_setopt($curl_handle, CURLOPT_VERBOSE, true);
curl_setopt($curl_handle, CURLINFO_HEADER_OUT, true);
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'wordpress-v1.4.3.0');
curl_setopt($curl_handle, CURLOPT_USERAGENT, 'wordpress-v1.4.4.0');

// Add Proxy support for Mailjet API requests
if(defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT') && defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD')) {
curl_setopt($curl_handle, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($curl_handle, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
curl_setopt($curl_handle, CURLOPT_PROXY, WP_PROXY_HOST . ':' . WP_PROXY_PORT);
curl_setopt($curl_handle, CURLOPT_PROXYPORT, WP_PROXY_PORT);
curl_setopt($curl_handle, CURLOPT_PROXYUSERPWD, WP_PROXY_USERNAME . ':' . WP_PROXY_PASSWORD);
}

$this->_request_post = false;
if ($request == 'POST')
Expand Down
11 changes: 10 additions & 1 deletion api/mailjet-api-v3.php
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,16 @@ private function sendRequest($object, $params, $method)
curl_setopt($this->_curl_handle, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($this->_curl_handle, CURLOPT_USERPWD, $this->_apiKey.':'.$this->_secretKey);
curl_setopt($this->_curl_handle, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($this->_curl_handle, CURLOPT_USERAGENT, 'wordpress-4.3.0');
curl_setopt($this->_curl_handle, CURLOPT_USERAGENT, 'wordpress-4.4.0');

// Add Proxy support for Mailjet API requests
if(defined('WP_PROXY_HOST') && defined('WP_PROXY_PORT') && defined('WP_PROXY_USERNAME') && defined('WP_PROXY_PASSWORD')) {
curl_setopt($this->_curl_handle, CURLOPT_HTTPPROXYTUNNEL, 1);
curl_setopt($this->_curl_handle, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
curl_setopt($this->_curl_handle, CURLOPT_PROXY, WP_PROXY_HOST . ':' . WP_PROXY_PORT);
curl_setopt($this->_curl_handle, CURLOPT_PROXYPORT, WP_PROXY_PORT);
curl_setopt($this->_curl_handle, CURLOPT_PROXYUSERPWD, WP_PROXY_USERNAME . ':' . WP_PROXY_PASSWORD);
}

switch ($method) {
case 'GET' :
Expand Down
Binary file modified i18n/wp-mailjet-de_DE.mo
Binary file not shown.
63 changes: 38 additions & 25 deletions i18n/wp-mailjet-de_DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Mailjet for wordpress\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-07-03 17:54+0300\n"
"PO-Revision-Date: 2018-07-03 17:54+0300\n"
"POT-Creation-Date: 2018-07-10 17:30+0300\n"
"PO-Revision-Date: 2018-07-10 17:30+0300\n"
"Last-Translator: Mailjet <[email protected]>\n"
"Language-Team: Mailjet <[email protected]>\n"
"Language: de\n"
Expand All @@ -12,7 +12,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop;__;_e\n"
"X-Poedit-Basepath: ..\n"
"X-Generator: Poedit 2.0.4\n"
"X-Generator: Poedit 2.0.8\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Poedit-SearchPath-0: .\n"

Expand Down Expand Up @@ -384,7 +384,7 @@ msgstr "Ermöglicht Ihren Besuchern die Anmeldung für eine Ihrer Listen"
msgid "Mailjet Subscription widget"
msgstr "Das Mailjet-Abonnement-Widget"

#: mailjet-widget.php:117
#: mailjet-widget.php:118
msgid ""
"You are either v1 user or we could not fetch user contact properties. Please "
"contact our <a target=\"_blank\" href=\"https://www.mailjet.com/support"
Expand All @@ -400,74 +400,87 @@ msgstr ""
"Mailjet-Abonnement-Widget konfigurieren, indem Sie auf die Schaltfläche "
"\"Weiter\" klicken und Schritt 2 und Schritt 3 durchführen."

#: mailjet-widget.php:472
#: mailjet-widget.php:516
msgid "Email field is empty"
msgstr ""

#: mailjet-widget.php:477
#: mailjet-widget.php:521
msgid "Missing list id"
msgstr ""

#: mailjet-widget.php:482 wp-mailjet.php:229 wp-mailjet.php:304
#: mailjet-widget.php:526 wp-mailjet.php:229 wp-mailjet.php:304
msgid "Invalid email"
msgstr "Ungültige E-Mail-Adresse"

#: mailjet-widget.php:492
#: mailjet-widget.php:536
#, php-format
msgid "The contact %s is already subscribed"
msgstr "Der Kontakt %s hat sich bereits angemeldet"

#: mailjet-widget.php:545 wp-mailjet.php:310
#: mailjet-widget.php:564
msgid ""
"You have entered a contact property with wrong data type, for example a "
"string instead of a number."
msgstr ""

#: mailjet-widget.php:574
msgid ""
"You have entered a Datetime contact property with Invalid date value. Valid "
"format for date time property is \"dd-mm-YYYY\" or \"dd/mm/YYYY\"."
msgstr ""

#: mailjet-widget.php:590 wp-mailjet.php:310
msgid "Confirm your mailing list subscription"
msgstr "Bestätigen Sie Ihre Anmeldung für die Mailing-Liste"
msgstr "Bitte bestätigen Sie Ihr Abonnement"

#: mailjet-widget.php:546 wp-mailjet.php:311
#: mailjet-widget.php:591 wp-mailjet.php:311
msgid "Please Confirm Your Subscription To"
msgstr "Bitte bestätigen Sie Ihre Anmeldung für"
msgstr ""
"Um den Newsletter von %s zu erhalten, bestätigen Sie bitte Ihr Abonnement, "
"indem Sie auf den folgenden Button klicken:"

#: mailjet-widget.php:549 wp-mailjet.php:314
#: mailjet-widget.php:594 wp-mailjet.php:314
msgid "Click here to confirm"
msgstr "Klicken Sie hier, um zu bestätigen"
msgstr "Ja, ich möchte diesen Newsletter abonnieren"

#: mailjet-widget.php:550 wp-mailjet.php:315
#: mailjet-widget.php:595 wp-mailjet.php:315
msgid "You may copy/paste this link into your browser:"
msgstr "Sie können diesen Link in Ihren Browser kopieren:"

#: mailjet-widget.php:552 wp-mailjet.php:317
#: mailjet-widget.php:597 wp-mailjet.php:317
msgid ""
"Did not ask to subscribe to this list? Or maybe you have changed your mind? "
"Then simply ignore this email and you will not be subscribed"
msgstr ""
"Sie haben sich nicht bei dieser Liste angemeldet? Oder haben Sie vielleicht "
"Ihre Meinung geändert? Dann ignorieren Sie diese E-Mail einfach, und Sie "
"werden nicht angemeldet"
"Wenn Sie diese E-Mail versehentlich erhalten haben oder sich nicht mehr "
"anmelden möchten, ignorieren Sie diese E-Mail einfach."

#: mailjet-widget.php:553 wp-mailjet.php:318
#: mailjet-widget.php:599 wp-mailjet.php:318
msgid "Thanks,"
msgstr "Vielen Dank,"

#: mailjet-widget.php:560 wp-mailjet.php:324
#: mailjet-widget.php:606 wp-mailjet.php:324
msgid "Subscription Confirmation"
msgstr "Bestätigung für die Anmeldung"

#: mailjet-widget.php:561
#: mailjet-widget.php:608
msgid ""
"Subscription confirmation email sent. Please check your inbox and confirm "
"the subscription."
msgstr ""
"Bestätigungsmail für die Anmeldung wurde gesendet. Bitte überprüfen Sie "
"Ihren Posteingang und bestätigen Sie die Anmeldung."

#: mailjet-widget.php:575
#: mailjet-widget.php:623
msgid "Error. Token verification failed."
msgstr "Fehler. Tokenüberprüfung konnte nicht durchgeführt werden."

#: mailjet-widget.php:620 wp-mailjet.php:262
#: mailjet-widget.php:668 wp-mailjet.php:262
#, php-format
msgid "Thanks for subscribing with %s"
msgstr "Vielen Dank für Ihre Anmeldung bei %s"

#: mailjet-widget.php:697
#: mailjet-widget.php:751
msgid "[email protected]"
msgstr "[email protected]"

Expand Down
Binary file added i18n/wp-mailjet-en_US.mo
Binary file not shown.
Loading

0 comments on commit 993ce05

Please sign in to comment.