Jump to content

How to hook into comments module to change notificationEmail?


Recommended Posts

Posted

I think that a config option in the core module might make sense here, and I don't usually suggest that but in this case I see it just being a checkbox labelled "email post author when new comments are made" which seems a but much having a whole module for it. In this case it would work for one blog with multiple authors or multiple blogs as well.

To be honest, you'd then want another one to toggle whether the admin email address gets an email with every comment as well as this might then be unnecessary on some sites.

The more I think about it the more options I want to add to the config but then we're getting away from a simple config option :)

  • Like 1
Posted

Pete: thanks. But how would that config option work? I mean all my blogs use same templates. Only thing different is path. Pretty hard to define on setting field.

Posted

I was assuming each author has their own account and therefore they would receive those emails instead of/as well as the system admin - I might not be understanding your setup well enough though.



In fact, it's not as simple as I thought as individual authors couldn't moderate just their own comments with the module (assuming you wanted to?) unless you rewrite a chunk of the module and let them have access to the comments manager.

Well that just got more complicated :)

Posted

Antti, I think you should be able to just set that email field before you output your comments. I don't think you'd need any modules or hooks or anything like that. So lets say you had a field on your page called comments_email. You may be able to do something like this:

if($page->comments_email) {
  $commentsField = $fields->get('comments'); 
  $commentsField->notificationEmail = $page->comments_email;
}
echo $page->comments->render();
echo $page->comments->renderForm(); 
  • Like 5
Posted

Even after two years of PW-development I seem to make things much more complicated than they are (same goes for you Petey-boy ;)). Thanks Ryan! 

  • Like 3
Posted

Even after two years of PW-development I seem to make things much more complicated than they are (same goes for you Petey-boy ;)). Thanks Ryan! 

LOL :biggrin:

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...