Hi there!
I posted this on the issue page that's referenced here in comment #15, but thought I'd post here as well...
This was a bit complicated, but I think I got it working..
Using Flag module to allow people to "follow" content, and the ECA module to send email notifications when there's a new comment on followed content/node or when the content/node itself is updated.
(Note: I'm dealing with a Spanish site, so forgive me if some of my terms aren't always correct in English.)
#1 Setup the flag system on the content type you're needing it on.
#2 Create a view that shows Content not Flags (See screenshot)
In the view settings under Format, I set it to use Unformatted list. Under the configuration for that you can uncheck the option for adding classes to the views rows.
Also, set it to show fields instead of content. And under that configuration, set them to show inline. Check it to hide empty fields.
In the view, add a relationship to the flag and check the option to "Include only flagged content". Set the radio button to select the option of any user instead of current user.
Add another relationship: User. This relationship depends on the other relationship that was just mentioned.
Add a field called User: Email address. (this depends on the User relationship) Set it so that it doesn't include the predefined classes. Under Rewrite Results, check the option to rewrite the output and add the token for that same field with a comma after it. (The reason for doing this is so that our email addresses are separated by commas.) Also, check the option to remove HTML tags, the checkmark to remove white spaces, and the checkmark to convert line breaks into HTML <br>
.
Under filter criteria set it to only show published content and the type of content you want.
Set the view to show all items instead of using a pager.
Under Contextual filters: Add "Content: ID" and set it to provide a default value if there are none available. In the type dropdown, select Content ID from URL.
I set the caching to none.
In summary; what we are doing with this view is showing all the email addresses for users that have flagged a specific content/node. (And it's filtered by injecting the content's ID via contextual filter argument.)
#3 Set up ECA.
I am using BPMN.io.
It's possible you wouldn't need them all, but I enabled all the ECA sub-modules except for the ECA Cache and ECA Migrate ones. Notice: Install the ECA Tamper module too (
https://www.drupal.org/project/eca_tamper →
). You may need to manually install the Tamper module (
https://www.drupal.org/project/tamper →
) if it doesn't automatically.
See screenshot of ECA.
Add the event "Insert content entity" and select the correct bundle/content type.
Add a Render: views action and select your new view. Make sure the correct view display is used. For arguments use "[comment:entity:nid]" (You may need to tweak this..?) Then, add a token name for the output of this action.
Add a "Tamper: find replace (multiline)". Enter the token you just created. In the "Text to find and the replacements" textarea, I have the following:
<br>|<span></span>
|
So it converts <br>
s to <span>
s and removes spaces.
Add a new token name for this output now.
Add a "Tamper: strip tags" action entering the new token you just created as the data to be tampered, and enter a new token to be used for what this outputs.
Add a "Tamper: explode" action. Enter the new token. For the string separator use a comma (I think that my be the default..?). Again enter a new token for this output.
After that, add a Gateway (the diamond shaped thingamajig).
After that, add a "List: remove item" action. Enter the last token you created, and set the method to "Drop first" (I think that might be default). Then add a new token for this output (should now be the individual email addresses).
Note: On the arrow between the Gateway diamond and this last "List: remove item" action that we added, set it to "Compare number of list items". Enter the token that we set as the outcome of the action just before it (the "Tamper: explode" action). Set it to Greater than and enter a value of "1" (Note: I set it to 1 instead of 0 because it seemed there was a blank item/email at the end. So to avoid it trying to send an email to a blank address, I did this.)
After the last action ("List: remove item"), enter a new action called: "Send email". For the email address / To field, enter the token with the output from the last action ("List: remove item"). Add your email body. You should be able to use tokens like [comment:entity:title], [comment:url], and [comment:author] in your email body. And set the dropdown to replace tokens: yes.
Add an arrow from this last action that sends the email to the gateway diamond so that it loops through the different email addresses till it gets to the end (or pretty much..).
-----
If you want to set up a notification system for content update instead of comment update, it is very similar. Instead of using the event "Insert Content Entity" at the beginning, set it to "Update Content Entity". And for the first "Render: views" action, set the argument to "[entity:nid]" instead of "[comment:entity:nid]".
I hope I described the setup good enough to help others (maybe even myself in the future :) )
-Caleb
Hi there!
This was a bit complicated, but I think I got it working..
Using Flag module to allow people to "follow" content, and the ECA module to send email notifications when there's a new comment on followed content/node or when the content/node itself is updated.
(Note: I'm dealing with a Spanish site, so forgive me if some of my terms aren't always correct in English.)
#1 Setup the flag system on the content type you're needing it on.
#2 Create a view that shows Content not Flags (See screenshot)
In the view settings under Format, I set it to use Unformatted list. Under the configuration for that you can uncheck the option for adding classes to the views rows.
Also, set it to show fields instead of content. And under that configuration, set them to show inline. Check it to hide empty fields.
In the view, add a relationship to the flag and check the option to "Include only flagged content". Set the radio button to select the option of any user instead of current user.
Add another relationship: User. This relationship depends on the other relationship that was just mentioned.
Add a field called User: Email address. (this depends on the User relationship) Set it so that it doesn't include the predefined classes. Under Rewrite Results, check the option to rewrite the output and add the token for that same field with a comma after it. (The reason for doing this is so that our email addresses are separated by commas.) Also, check the option to remove HTML tags, the checkmark to remove white spaces, and the checkmark to convert line breaks into HTML
.
Under filter criteria set it to only show published content and the type of content you want.
Set the view to show all items instead of using a pager.
Under Contextual filters: Add "Content: ID" and set it to provide a default value if there are none available. In the type dropdown, select Content ID from URL.
I set the caching to none.
In summary; what we are doing with this view is showing all the email addresses for users that have flagged a specific content/node. (And it's filtered by injecting the content's ID via contextual filter argument.)
#3 Set up ECA.
I am using BPMN.io.
It's possible you wouldn't need them all, but I enabled all the ECA sub-modules except for the ECA Cache and ECA Migrate ones. Notice: Install the ECA Tamper module too (
https://www.drupal.org/project/eca_tamper →
). You may need to manually install the Tamper module (
https://www.drupal.org/project/tamper →
) if it doesn't automatically.
See screenshot of ECA.
Add the event "Insert content entity" and select the correct bundle/content type.
Add a Render: views action and select your new view. Make sure the correct view display is used. For arguments use "[comment:entity:nid]" (You may need to tweak this..?) Then, add a token name for the output of this action.
Add a "Tamper: find replace (multiline)". Enter the token you just created. In the "Text to find and the replacements" textarea, I have the following:
|
|
So it converts
s to s and removes spaces.
Add a new token name for this output now.
Add a "Tamper: strip tags" action entering the new token you just created as the data to be tampered, and enter a new token to be used for what this outputs.
Add a "Tamper: explode" action. Enter the new token. For the string separator use a comma (I think that my be the default..?). Again enter a new token for this output.
After that, add a Gateway (the diamond shaped thingamajig).
After that, add a "List: remove item" action. Enter the last token you created, and set the method to "Drop first" (I think that might be default). Then add a new token for this output (should now be the individual email addresses).
Note: On the arrow between the Gateway diamond and this last "List: remove item" action that we added, set it to "Compare number of list items". Enter the token that we set as the outcome of the action just before it (the "Tamper: explode" action). Set it to Greater than and enter a value of "1" (Note: I set it to 1 instead of 0 because it seemed there was a blank item/email at the end. So to avoid it trying to send an email to a blank address, I did this.)
After the last action ("List: remove item"), enter a new action called: "Send email". For the email address / To field, enter the token with the output from the last action ("List: remove item"). Add your email body. You should be able to use tokens like [comment:entity:title], [comment:url], and [comment:author] in your email body. And set the dropdown to replace tokens: yes.
Add an arrow from this last action that sends the email to the gateway diamond so that it loops through the different email addresses till it gets to the end (or pretty much..).
-----
If you want to set up a notification system for content update instead of comment update, it is very similar. Instead of using the event "Insert Content Entity" at the beginning, set it to "Update Content Entity". And for the first "Render: views" action, set the argument to "[entity:nid]" instead of "[comment:entity:nid]".
I hope I described the setup good enough to help others (maybe even myself in the future :) )
-Caleb
Yes, I am looking for the same/similar functionality! How do we accomplish this?
Thanks!
-Caleb
I tried installing this module on a Drupal 10 site and it didn't install. I'm noticing that it doesn't have the ^ with the 10 version (^10) in the info file nor here on the module page. I'm not 100% sure, but am wondering if that's the culprit.. Could this be fixed?
Thanks!
Hi there,
So, we've had a similar issue on more than one site. We had signed up for some server security/hardening and it appears that some of those settings affect this, like ModSecurity..? A guy from support installed the ConfigServer ModSecurity Control plugin in WHM for whitelisting rules..
One thing about this is that I think it's kinda hard to find site errors in the log when it happens, to figure out what is going on. But, you can go to the ConfigServer ModSec Control in WHM and view the ModSecurity log. If one shows up, you can copy the id and paste it in the whitelist for that domain/website.
So.. something to take into account!
-Caleb