8 Replies Latest reply on Jul 11, 2014 9:21 PM by michaelfr RSS
    michaelfr Creator

    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

      • Blog Comment Notification
        saeedma Apprentice

        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



        • Blog Comment Notification
          michaelfr Creator

          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

           



          • Blog Comment Notification
            michaelfr Creator

            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

             



              • Blog Comment Notification
                adam Creator

                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.