You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added typehints to methods
- Added code for making plugin WP VIP GO compatible for the `From mail`
- Added Toastr for sending nice message instead of using alerts
'Mailgun ' + data.method + ' Test ' + data.message
178
-
+ '; status "' + data.error + '"'
179
-
)
179
+
if (typeof data.message !== 'undefined' && data.message === 'Failure') {
180
+
toastr.error('Mailgun ' + data.method + ' Test ' + data.message
181
+
+ '; status "' + data.error + '"');
182
+
} else {
183
+
toastr.success('Mailgun ' + data.method + ' Test ' + data.message
184
+
+ '; status "' + data.error + '"');
185
+
}
180
186
})
181
187
.error(function () {
182
-
alert('Mailgun Test <?php_e('Failure', 'mailgun'); ?>')
188
+
toastr.error('Mailgun Test <?php_e('Failure', 'mailgun'); ?>')
183
189
})
184
190
})
185
191
jQuery('#mailgun-form').change(function () {
@@ -197,7 +203,7 @@ public function admin_footer_js()
197
203
* @return void
198
204
*
199
205
*/
200
-
publicfunctionoptions_page()
206
+
publicfunctionoptions_page(): void
201
207
{
202
208
if (!@include'options-page.php') {
203
209
printf(__('<div id="message" class="updated fade"><p>The options page for the <strong>Mailgun</strong> plugin cannot be displayed. The file <strong>%s</strong> is missing. Please reinstall the plugin.</p></div>',
@@ -211,7 +217,7 @@ public function options_page()
211
217
* @return void
212
218
*
213
219
*/
214
-
publicfunctionlists_page()
220
+
publicfunctionlists_page(): void
215
221
{
216
222
if (!@include'lists-page.php') {
217
223
printf(__('<div id="message" class="updated fade"><p>The lists page for the <strong>Mailgun</strong> plugin cannot be displayed. The file <strong>%s</strong> is missing. Please reinstall the plugin.</p></div>',
@@ -427,13 +436,19 @@ public function ajax_send_test()
427
436
), JSON_THROW_ON_ERROR)
428
437
);
429
438
}
430
-
$result = wp_mail(
431
-
$admin_email,
432
-
__('Mailgun WordPress Plugin Test', 'mailgun'),
433
-
sprintf(__("This is a test email generated by the Mailgun WordPress plugin.\n\nIf you have received this message, the requested test has succeeded.\n\nThe sending region is set to %s.\n\nThe method used to send this email was: %s.",
434
-
'mailgun'), $region, $method),
435
-
['Content-Type: text/plain']
436
-
);
439
+
440
+
try {
441
+
$result = wp_mail(
442
+
$admin_email,
443
+
__('Mailgun WordPress Plugin Test', 'mailgun'),
444
+
sprintf(__("This is a test email generated by the Mailgun WordPress plugin.\n\nIf you have received this message, the requested test has succeeded.\n\nThe sending region is set to %s.\n\nThe method used to send this email was: %s.",
0 commit comments