Not logged in. · Lost password · Registration disabled
Forum: Overview Suggestions and Wishes / Anregungen und Wünsche RSS
Improving debug mode - done
Notify when there are no emails assigned to a category.
jeffsherk #1
Member since Nov 2007 · 37 posts
Group memberships: Mitglieder
Show profile · Link to this post
Subject: Improving debug mode
Here's a couple suggestions to improve the readability of debug mode.

If you notice the text below, the second Sending Post (#95) says that emails were found, but this is little misleading, since there are no emails assigned to the category of that post. IT would be nice to see an extra line that reads something like 'No emails assigned to category.'.

Also, putting a blank line between the Sending of Posts would make it a little easier to read.

The text below has the changes included, and I have included the suggested code changes at the bottom of the post.

Sending post: 94
The cat-Ids are: 4, 3, 0
Emails were found.
Date1: November 28, 2007
Date2: November 28, 2007
Date3: November 28, 2007
Date4: November 28, 2007
Email variables:
Emailtype TEXT
@@title iii
@@permalink http://www.mydomain.com/blog/2007/11/28/iii/
@@author jsherk
@@time 10:31 am
@@date November 28, 2007
Sending mail to: webmaster@mydomain.com

Sending post: 95
The cat-Ids are: 3, 0
Emails were found.
No emails assigned to category.

Sending post: 96
The cat-Ids are: 1, 0
Emails were found.
Date1: November 28, 2007
Date2: November 28, 2007
Date3: November 28, 2007
Date4: November 28, 2007
Email variables:
Emailtype TEXT
@@title yyy
@@permalink http://www.mydomain.com/blog/2007/11/28/yyy/
@@author jsherk
@@time 10:31 am
@@date November 28, 2007
Sending mail to: webmaster@mydomain.com

Number of Subscribers: 1


ADD BLANK LINE:
This is the easiest way to do it. In sendmail.php, find the line that reads
echo 'Sending post: ' . $post->id . '<br />';

and insert this new line right above it
echo '<br />';

so that it looks like this
echo '<br />';
echo 'Sending post: ' . $post->id . '<br />';

ADD 'No emails assigned to category'
Again, in sendmail.php, we just need to add an ELSE statement. Look for
wp_mail($email->email_addr, $maildata['subject'], $msgFinal, $maildata['header']);
$maxsend--;
}
}

Add these lines AFTER the second curly bracket(})
else {
if(get_option('post_notification_debug') == 'yes') {
echo 'No emails assigned to category.<br />';
}
}

So it looks like this
wp_mail($email->email_addr, $maildata['subject'], $msgFinal, $maildata['header']);
$maxsend--;
}
}
else {
if(get_option('post_notification_debug') == 'yes') {
echo 'No emails assigned to category.<br />';
}
}


Hope these are helpful!
Morty (Administrator) #2
User title: Author
Member since Jun 2007 · 928 posts
Group memberships: Administratoren, Mitglieder
Show profile · Link to this post
Hi jeff,
thanks for the feedback. The debug mode was only for me to find other people's problems and normally knew where to look and didn't care for eye candy. :-)

I did things a bit different then you suggested, but I think that is ok. :-) I attached a preview.
The author has attached one file to this post:
sendmail.php | Save   10.9 kBytes, downloaded 411 times
jeffsherk #3
Member since Nov 2007 · 37 posts
Group memberships: Mitglieder
Show profile · Link to this post
Yes, I like that better than my suggestions!!

Thanks
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum