Email Notifications for site owners

    Problem

      Send an email notification to the site owner whenever a new comment is created on any document in that site.

    Solution

      We already have comment events in the activity feed API. From those we can fetch the comment object, which includes a targetAccount CID and a targetPath. Is the targetAccount itself the site’s owning account? Eric Vicenti Gabo H Beaumont horacio

      1

      If that’s correct, then the flow would be:

        On each new comment event, fetch the comment.

        Resolve the site owner from targetAccount

        Skip notifications if the site owner is also the comment author.

        Check the owner’s notification preferences to see if email is enabled.

        If enabled, send a notification with the email url.

      One question that I have is: can a single account own multiple sites? If yes, we probably need to add notification settings per site?

      1