All comments to central e-mail address
All comments to central e-mail address
Hello,
First of all I'd like to thank the developers of Serendipity for their job well done. I love the software and the way it has been created. I do have a question, though. Before posting here, I have tried to get an answer on my question with the search function, but I couldn't find a solution.
I would like my serendipity to send copies of ALL comments (not entries!) to a central e-mail address (the "admin" address?). Naturally I already receive the comments on entries that I create, but I'd like to keep track of ALL comments and comments to comments that ALL authors receive. In other words, each time someone sends a comment to an entry, I would like serendipity to send a copy of the e-mail that the original author receives to a central (admin?) address.
Would someone be able to and prepared to post the solution for making this happen here?
Thanks for your time and help...
- Mickel
First of all I'd like to thank the developers of Serendipity for their job well done. I love the software and the way it has been created. I do have a question, though. Before posting here, I have tried to get an answer on my question with the search function, but I couldn't find a solution.
I would like my serendipity to send copies of ALL comments (not entries!) to a central e-mail address (the "admin" address?). Naturally I already receive the comments on entries that I create, but I'd like to keep track of ALL comments and comments to comments that ALL authors receive. In other words, each time someone sends a comment to an entry, I would like serendipity to send a copy of the e-mail that the original author receives to a central (admin?) address.
Would someone be able to and prepared to post the solution for making this happen here?
Thanks for your time and help...
- Mickel
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: All comments to central e-mail address
Hi!
Actually, s9y does not support this "out of the box", so you need to install a plugin to do that for you.
Luckily, such a plugin is VERY easy to do.
Just copy and paste the code below and save it inside /plugins/serendipity_event_mailcc/serendipity_event_mailcc.php. Then you go to your s9y admin panel, go to 'configure plugins', click on "click here to install an event plugin" and select the plugin "Adds CC to all sent emails" from the list. This will have a config screen where you can enter an email adress which will get each and every single email that s9y spews out.
This plugin has a simple caveat: E-Mails will only be sent, if the owner of an entry has "Send notification for comments" enabled. Else, an email will not be send, and thus you can't get a CC. To alter this functionality, changes in the core of s9y would need to be made, which I currently think should not really be necessary.
Of course, one other possibility for you is to just subscribe to the RSS comment feed of your blog, as this will contain all comments made to the blog
But now for the simple plugin:
HTH,
Garvin
Actually, s9y does not support this "out of the box", so you need to install a plugin to do that for you.
Luckily, such a plugin is VERY easy to do.
Just copy and paste the code below and save it inside /plugins/serendipity_event_mailcc/serendipity_event_mailcc.php. Then you go to your s9y admin panel, go to 'configure plugins', click on "click here to install an event plugin" and select the plugin "Adds CC to all sent emails" from the list. This will have a config screen where you can enter an email adress which will get each and every single email that s9y spews out.
This plugin has a simple caveat: E-Mails will only be sent, if the owner of an entry has "Send notification for comments" enabled. Else, an email will not be send, and thus you can't get a CC. To alter this functionality, changes in the core of s9y would need to be made, which I currently think should not really be necessary.
Of course, one other possibility for you is to just subscribe to the RSS comment feed of your blog, as this will contain all comments made to the blog
But now for the simple plugin:
Code: Select all
<?php # $Id: serendipity_event_emoticate.php 1600 2007-01-26 10:01:30Z garvinhicking $
if (IN_serendipity !== true) {
die ("Don't hack!");
}
class serendipity_event_mailcc extends serendipity_event
{
var $title = 'Adds CC to all sent emails';
function introspect(&$propbag) {
global $serendipity;
$propbag->add('name', 'Adds CC to all sent emails');
$propbag->add('description', '(Notice: Make sure that the all of your authors have the option to receiv comment notification emails activated, or else no mails will be created that can be CCed');
$propbag->add('stackable', false);
$propbag->add('author', 'Garvin Hicking');
$propbag->add('version', '1.0');
$propbag->add('requirements', array('serendipity' => '0.8','smarty' => '2.6.7','php' => '4.1.0'
));
$propbag->add('groups', array('BACKEND_FEATURES'));
$propbag->add('event_hooks', array('backend_sendmail' => true));
$propbag->add('configuration', array('cc'));
}
function generate_content(&$title) {
$title = $this->title;
}
function introspect_config_item($name, &$propbag) {
switch($name) {
case 'cc':
$propbag->add('type', 'string');
$propbag->add('name', 'E-Mail address to CC');
$propbag->add('description', '');
$propbag->add('default', 'nobody@example.com');
break;
}
return true;
}
function event_hook($event, &$bag, &$eventData) {
global $serendipity;
$hooks = &$bag->get('event_hooks');
if (isset($hooks[$event])) {
switch($event) {
case 'backend_sendmail':
$eventData['headers'][] = 'CC: ' . $this->get_config('cc');
return true;
break;
default:
return false;
}
} else {
return false;
}
}
}
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Thank you!!
I just installed the plugin and it works WONDERS!! You're good!!
Thank you so much for taking the time to do this for me. I really appreciate it
. I have to try and get into the details of Smarty. It looks easy, but I am not as PHP literate.
Anyways, thanks again
Thank you so much for taking the time to do this for me. I really appreciate it
Anyways, thanks again
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Thank you!!
Hi!
Great to hear that it works, you'Re welcome.
Best regards,
Garvin
Great to hear that it works, you'Re welcome.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
Re: All comments to central e-mail address
Will it be put to spartacus?garvinhicking wrote: Just copy and paste the code below and save it inside /plugins/serendipity_event_mailcc/serendipity_event_mailcc.php.
Ciao, Stephan
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: All comments to central e-mail address
Hi!
Best regards,
Garvin
Nah, this is IMHO too small for too little benefit to let it clod up spartacus.Will it be put to spartacus?
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
hm, 1st I think nothing is too little, our plugin-pool must grown up!
2nd: I believe that this plugin can be interesting for every non-single-user-blog because - as I wrote many time before - even emails with "please approve a comment" go to the article-author wo has not the privileges to approve. So, with this plugin, these emails can go to one admin-user, too.
2nd: I believe that this plugin can be interesting for every non-single-user-blog because - as I wrote many time before - even emails with "please approve a comment" go to the article-author wo has not the privileges to approve. So, with this plugin, these emails can go to one admin-user, too.
Ciao, Stephan
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Best regards,
Garvin
But not with the current Spartacus infrastructure. The large package.xml is already too large and fails on servers with only 8MB memory.stm999999999 wrote:hm, 1st I think nothing is too little, our plugin-pool must grown up!
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
stm999999999
- Regular
- Posts: 1531
- Joined: Tue Mar 07, 2006 11:25 pm
- Location: Berlin, Germany
- Contact:
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Lars Strojny offered to do some work on improving spartacus and changing the API. Let's see what he/we can come up with.
Best regards,
Garvin
Lars Strojny offered to do some work on improving spartacus and changing the API. Let's see what he/we can come up with.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
cleanforum
- Regular
- Posts: 6
- Joined: Sun Mar 04, 2007 2:04 pm
Hi,
I have installed Garvin's Plugin and it gives this in the header of the administration panel and in the box indicating "your entry has been saved".
Any idea ? It could scare my authors 
I have installed Garvin's Plugin and it gives this in the header of the administration panel and in the box indicating "your entry has been saved".
Code: Select all
Warning: Cannot modify header information - headers already sent by (output started at /mnt/136/free.fr/e/c/akeow/serendipity/plugins/serendipity_event_mailcc/serendipity_event_mailcc.php:2) in /mnt/136/free.fr/e/c/akeow/serendipity/include/functions_config.inc.php on line 567
Warning: Cannot modify header information - headers already sent by (output started at /mnt/136/free.fr/e/c/akeow/serendipity/plugins/serendipity_event_mailcc/serendipity_event_mailcc.php:2) in /mnt/136/free.fr/e/c/akeow/serendipity/plugins/serendipity_event_httpauth/serendipity_event_httpauth.php on line 185
Warning: Cannot modify header information - headers already sent by (output started at /mnt/136/free.fr/e/c/akeow/serendipity/plugins/serendipity_event_mailcc/serendipity_event_mailcc.php:2) in /mnt/136/free.fr/e/c/akeow/serendipity/serendipity_admin.php on line 11-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
You might have saved the file with a whitspace/newline before the first <?php or after the last ?>, remove that and the error will go away.
Regards,
Garvin
You might have saved the file with a whitspace/newline before the first <?php or after the last ?>, remove that and the error will go away.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/