Skip to content

Commit 0cd1d92

Browse files
Fallback option added to have ability to turn on/off it.
Information about Tracking settings Widget style fixes
1 parent 5e5991f commit 0cd1d92

5 files changed

Lines changed: 48 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Changelog
22
=========
33

4+
2.1.9 (2025-06-24)
5+
- Added fallback option. Merge PR for widget
6+
47
2.1.8 (2025-05-11)
58
- Just keep update WP version. And tested compatibility with it
69

includes/options-page.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
$suppressClicks = $this->get_option('suppress_clicks') ?: 'no';
6363
$emailFallback = $this->get_option('email_fallback') ?: 'no';
6464

65+
$settings = [];
66+
try {
67+
$settings = $mailgun->getTrackingSettings();
68+
} catch (Throwable $e) {
69+
}
70+
6571
?>
6672
<div class="wrap">
6773
<div id="icon-options-general" class="icon32"><br/></div>
@@ -117,6 +123,24 @@
117123
<?php settings_fields('mailgun'); ?>
118124

119125
<table class="form-table">
126+
<?php if ($settings) : ?>
127+
<tr>
128+
<th><?php _e('Domain tracking settings from account', 'mailgun'); ?></th>
129+
<td>
130+
<ul>
131+
<li>
132+
<b>Click tracking</b> &mdash; <?php echo $settings['tracking']['open']['active'] == 1 ? 'Yes' : 'No'?>
133+
</li>
134+
<li>
135+
<b>Open tracking</b> &mdash; <?php echo $settings['tracking']['click']['active'] == 1 ? 'Yes' : 'No'?>
136+
</li>
137+
<li>
138+
<b>Unsubscribes</b> &mdash; <?php echo $settings['tracking']['unsubscribe']['active'] == 1 ? 'Yes' : 'No'?>
139+
</li>
140+
</ul>
141+
</td>
142+
</tr>
143+
<?php endif; ?>
120144
<tr valign="top">
121145
<th scope="row">
122146
<?php _e('Select Your Region', 'mailgun'); ?>

mailgun.php

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Mailgun
44
* Plugin URI: http://wordpress.org/extend/plugins/mailgun/
55
* Description: Mailgun integration for WordPress
6-
* Version: 2.1.8
6+
* Version: 2.1.9
77
* Requires PHP: 7.4
88
* Requires at least: 4.4
99
* Author: Mailgun
@@ -294,6 +294,21 @@ public function get_lists(): array {
294294
return $results;
295295
}
296296

297+
/**
298+
* @return array
299+
* @throws JsonException
300+
*/
301+
public function getTrackingSettings(): array
302+
{
303+
$domain = ( defined( 'MAILGUN_DOMAIN' ) && MAILGUN_DOMAIN ) ? MAILGUN_DOMAIN : $this->get_option( 'domain' );
304+
if (!$domain) {
305+
return [];
306+
}
307+
$settings = $this->api_call(sprintf("domains/%s/tracking", $domain), [], 'GET' );
308+
309+
return json_decode( $settings, true, 512, JSON_THROW_ON_ERROR );
310+
}
311+
297312
/**
298313
* Handle add list ajax post.
299314
*

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Mailgun for WordPress
44
Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller
55
Tags: mailgun, smtp, http, api, mail, email
66
Tested up to: 6.8.1
7-
Stable tag: 2.1.8
7+
Stable tag: 2.1.9
88
Requires PHP: 7.4
99
License: GPLv2 or later
1010

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Mailgun for WordPress
44
Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller
55
Tags: mailgun, smtp, http, api, mail, email
66
Tested up to: 6.8.1
7-
Stable tag: 2.1.8
7+
Stable tag: 2.1.9
88
Requires PHP: 7.4
99
License: GPLv2 or later
1010

@@ -129,6 +129,9 @@ MAILGUN_TRACK_OPENS Type: string Choices: 'yes' or 'no'
129129

130130
== Changelog ==
131131

132+
= 2.1.9 (2025-06-24): =
133+
- Added fallback option. Merge PR for widget
134+
132135
= 2.1.8 (2025-05-11): =
133136
- Just keep update WP version. And tested compatibility with it
134137

0 commit comments

Comments
 (0)