Jump to content
franciccio-ITALIANO

Comments: email notifications to varios admin

Recommended Posts

Hi, I see that in processwire I can choose the admin which send the approvation.

I would like choose an admin for a group of comments pages, and another admin per other groupo of comments pages.

It's possible?
 

Share this post


Link to post
Share on other sites

Three solutions immediately spring to mind:

a) Create different comments fields for each group of pages (downsides: you have to keep other settings in sync and page queries may have to run over both fields)

b) If all comments pages are at the same depth (or not too deeply nested) and each has a unique (might also be grand-) parent, you can create a field on those ancestors that holds the admin contact email and use the "field:" syntax in Admin notification email:

field:parent.adminemail
// or, for grandchildren
field:parent.parent.adminemail

You could even set multiple sources this way if the adminemail might be either on the parent or the grandparent (just make sure it isn't set on both). The comments field will only use valid emails, so if a parent or grandparent doesn't have the field (or doesn't exist), that entry will be ignored.

field:parent.adminemail,field:parent.parent.adminemail

c) In some scenarios, you want to send notifications to the user that created the page. In that case, you can use

field:createdUser.email

The big downside of that approach is that when the creator of the page is no longer available to approve comments, the createdUser field has to be changed or a different email address assigned in their profile settings (and comment notifications might get lost if nobody thinks of that).

It should also be possible to populate $field->notificationEmail through a hook, but from the top of my head, I can't name a convenient method to hook into.

  • Like 2

Share this post


Link to post
Share on other sites
On 6/1/2018 at 5:19 PM, BitPoet said:

b) If all comments pages are at the same depth (or not too deeply nested) and each has a unique (might also be grand-) parent, you can create a field on those ancestors that holds the admin contact email and use the "field:" syntax in Admin notification email:

@BitPoet I have totally missed this "field:createdUser.email" syntax. Is this documented somewhere and what are all the places that it can be used? Is it only module/field configs or some other places also?

Share this post


Link to post
Share on other sites

@apeisa: this is just for FieldtypeComments and documented on the details tab for comments fields, where it can be used.

Edit_Field_blog_comments.thumb.png.b5456350ea294198912588b2ae390550.png

  • Like 2

Share this post


Link to post
Share on other sites

Thanks @BitPoet!

I thought it was something more generic, but now it makes sense why I have missed it 😄

  • Like 1
  • Haha 1

Share this post


Link to post
Share on other sites
On 1/23/2019 at 1:08 PM, BitPoet said:

@apeisa: this is just for FieldtypeComments and documented on the details tab for comments fields, where it can be used.

Edit_Field_blog_comments.thumb.png.b5456350ea294198912588b2ae390550.png

May i use something like "group:editors" as well?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...