Drupal 7: Rules(Sending Emails) - Comment reply notification

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
now in this video we're going to create another rule that will notify the author of the comment when their comment gets a reply we'll also add a condition that prevents it from sending an email if the user who replied to the comment is also the author of the original comment we'll do this in the same way i'll go ahead and log in as the administrator user go to configuration workflow rules now you can see our rule that we created recently i'm going to go ahead and click add a new rule this one will be comment reply notification and we're going to react on the event after saving a new comment just like before then we're going to go ahead and add our condition and do a data comparison again the first data selector will be the comment author equals comment parent author so this is the parent comment that the current comment is being posted as a reply to a little confusing but it makes sense and then again negate to make sure that our rule only fires when these are not the same so go ahead and click save then we'll add our action again it's going to be send mail the two value will switch to the data selection and choose comment parent author mail because we're going to send this to the email address of the author of the parent comment our subject will be reply to we'll find the title of the parent node which will be comment parent and then our message review the complete topic at find our comment url posted by comment name and the name of the comment author title comment title and then on our body we'll find the comment body and the from i'm going to leave empty this time and that'll just use the sitewide configured address so we'll just click save and now let's go ahead and try this out go ahead and go back to our homepage and find our sample article first thing we're going to do is reply to our own comment we'll click save and there's no email sent so that's perfect let's log out now and log back in as chelsea and i have her reply to that comment and hit save now let's check our email there's actually been two emails sent because of our two rules so the first is the original rule that we sent this was to the node author and the next is a reply to sample comment which is from the site-wide email address to me posted by chelsea and you have everything here finally i want to show you one last thing i'm gonna log back in as brian and show you that when i reply to chelsea's comment she should get an email so we'll go ahead and click save and check our email and now we can see that this was sent to chelsea from the site-wide email address and it says it's posted by brian etc and this time we don't have a second one because i being brian was also the node author so that original rule did not fire so that's how you can notify users when their comments are commented on
Info
Channel: Brian Lewis
Views: 6,431
Rating: 5 out of 5
Keywords: Drupal, How-To
Id: jwqW7zN0eTY
Channel Id: undefined
Length: 5min 34sec (334 seconds)
Published: Wed Aug 28 2013
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.