#20353 closed enhancement (fixed)
Add filter for email recipients in wp_notify_moderator()
| Reported by: | lexhair | Owned by: | nacin |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Comments | Version: | 3.3.1 |
| Severity: | minor | Keywords: | has-patch needs-testing |
| Cc: | Focuses: |
Description
As administrator, I would like more control over email notifications when comments are marked for moderation without having to overwrite the pluggable function wp_notify_moderator.
The function wp_notify_moderator sends emails to post authors (when they have sufficient roles) and the admin by hard coding the $email_to array. I'd like to see the $email_to array sent to a filter with $comment before wp_mail() is called. That would allow me to write a theme function to manipulate the $email_to array to add or delete recipients.
My workaround was to write a site specific plugin that overwrote wp_notify_moderator() to manipulate the $email_to array.
Attachments (1)
Change History (9)
#2
@
15 years ago
#8833 is a big task.
Many of the pluggable functions, including wp_notify_moderator() have filter hooks already available. This would be a simple line of code which I'd be happy to prepare a patch for that would apply a filter.
I could have made this work by hooking into wp_mail() but phpmailer makes the To: address property protected which was giving me fits to manipulate it.
#3
@
14 years ago
I agree lexhair, this filter is easy to implement and in fact, i'm wondering why the foreach loops on a single item oO
It seems a filter is missing here!
How can i propose a patch?
#4
@
14 years ago
- Component General → Comments
- Keywords has-patch needs-testing added
Patch passes $email_to array through apply_filters(), for the 'comment_moderation_email_to' filter.
Related: #22922
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #8833