kymc
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [Mailgun for WordPress] BUG: Undefined index: o:tagUpdate: I’m fixing it like this in my plugin:
add_filter( 'option_mailgun', 'fix_busted_mailgun_options_logic_in_wp_mail', 10, 2); function fix_busted_mailgun_options_logic_in_wp_mail( $options, $option_name ){ unset( $options['campaign-id'] ); unset( $options['tag'] ); return $options; }
Note – obviously you won’t be posting any tags to the Mailgun API if you use this – but your php logs will thank you if you’re sending lots of email..
Forum: Plugins
In reply to: [Mailgun for WordPress] BUG: Undefined index: o:tagYep, I have been looking at this today myself. Mail will still send but you’re going to keep logging php notices until it’s fixed.. this is the block of code that’s causing the problem(s) – unfortunately there are plenty of issues so I have pointed them out inline. Hopefully someone from Mailgun, or whoever is meant to be maintaining the project starts monitoring this forum and or github so this and any other issues get sorted out.
///mailgun/includes/wp-mail.php:146-159 if ( isset( $mailgun['tag'] ) ){ //1. $mailgun['tag'] is never set for me.. I have manually set it to a domain/string using the option_mailgun filter hook. $tags = explode(",", str_replace(" ","", $mailgun['tag'])); $body['o:tag'] = $tags; //2. if we got in here, right now $body['o:tag'] is an array... } // campaign-id now refers to a list of tags which will be appended to the site tag if ( isset( $mailgun['campaign-id'] ) ){ $tags = explode(",", str_replace(" ","", $mailgun['campaign-id'])); //3. $tags now is an array... if ($body['o:tag']=='') { //4. This conditional is never going to be true because $body['o:tag'] is either not set (see 1.) or an array (see 2.) by this stage. $body['o:tag']= $tags; } else { $body['o:tag'].=','.$tags; //5. If we get in here, $body['o:tag'] is an array (see 2.), so we're trying to concatenate an array with a string (',') with an array (see 3.)... and we're going to get more notices in our logs. } }
Viewing 2 replies - 1 through 2 (of 2 total)