cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Blog Comment Notification

ptc-6292144
3-Visitor

Blog Comment Notification

Hello,

I am wondering if there is a snippet I could use to have an email sent to a user when their blog post gets commented on. I have noticed that I receive an email when a post on the community site gets commented on and wanted to know how I could incorporate that.

Thank you,
Mike

8 REPLIES 8
smanley
13-Aquamarine
(To:ptc-6292144)

Hi Michael,

There is the

SendMessage

service snippet on the MailServer ThingTemplate that you can call from a subscription on your blog. 


1.) Create a Notification Thing that implements the MailServer Template and configure your SMTP settings here. 

2.) On your Blog Thing, create a service to send messages using the SentMessage Snippet from your Notification Thing in the Entities tab.           Set the message, subject, and email address in the parameters of this service.

3.) On your Blog, add a subscription with

AddComment

as the event trigger and call your send message

Service

from this

Subscription

.


Thanks,

Saeed



Nevermind Saeed, I was able to figure it out.

Thank you,

Mike



Saeed,

Thank you for the response! For the "from" portion of the SentMessage snippet should I put the name of the Notification Thing or the email address I setup within the Notification Thing?

Thank you,

Mike



adam11
5-Regular Member
(To:ptc-6292144)

Hi Mike,

You'll put the email address that you are using to send email, not the name of the Thing sending it.

Also,

How do I set the email address to the user's email address who's post was commented on as well as reference what the comment said?

Thank you,

Mike



adam11
5-Regular Member
(To:ptc-6292144)

Mike,

When an Event is triggered, it sends relevant data to any Thing that subscribes to it. In the case of CommentAdd, you get the id of the Blog entry, the type of entry and the comment's id and the parent's id. With this information, you can retrieve the Blog entry using GetComment() or a similar Service and retrieve the source of the comment's email address by access his emailAddress User Extension.

adam11
5-Regular Member
(To:adam11)

Mike,

Just wanted to touch base with you and see how you're making out with this functionality. If necessary, I can provide you with a simple example of how to send emails when a new comment is added.

Thanks Adam! I was able to figure it out unfortunately the network I am on will not allow emails sent on port 25. Trying to find a work around to it currently.



Top Tags