ManifoldScholar / manifold

Transforming scholarly publications into living digital works.
http://manifoldapp.org
GNU General Public License v3.0
237 stars 31 forks source link

Create Email Notifications for Manifold Activities #951

Closed mkgold closed 6 years ago

mkgold commented 6 years ago

Feature Description

A configurable email notification system (with optional daily/weekly digest modes) that will notify Manifold admins and editors about a) new projects; b) new texts uploaded to an instance; c) comments; d) annotations

Why is this feature important? Who does it help?

This feature will help admins keep abreast of overall activity on a Manifold instance. It will also be useful to editors and authors who want to know about (and, perhaps, respond to) new comments and annotations

User Stories

A Manifold instance admin grants an editor or project creator role to someone, but wants to keep track of what texts are uploaded to be sure that nothing is uploaded outside of copyright restrictions. An email notification of a new project creation or new text upload will remind the admin to look over the newly uploaded text.

An author whose text is uploaded wants to be notified of new comments on their text so that they can respond to reader queries, notes, and responses. The activity drives further commenting and interaction with the text.

Design Notes

the settings should be configurable so that people can choose to receive notifications as the associated activity occurs or through a digest mode (daily or weekly). The settings should also be configurable on a per-project basis (ie, an editor may want email updates on one project but not another)

Development Notes

tsmyre commented 6 years ago

@mkgold Should there also be an email system for readers to opt into if they want notice when a project they are following is updated?

mkgold commented 6 years ago

ooh -- yes @tsmyre -- that is a good idea.

SMaxOwok commented 6 years ago
# READER NOTIFICATION PREFERENCES

Send me updates about projects I'm following:
never || daily || weekly

Notify me of replies to my annotations and comments:
never || yes

# AUTHOR / PROJECT EDITOR NOTIFICATION PREFERENCES

Send me reporting about my projects:
never || daily || weekly

Send me a digest of all new public annotations and comments on my texts:
never || daily || weekly

Notify me of all new replies and comments on my texts:
never || yes

# ADMIN NOTIFICATION PREFERENCES

Send me a digest of all new comments and public annotations
never || daily || weekly

Notify me of flagged comments
never || yes
SMaxOwok commented 6 years ago

Also included in this will be the addition of a COMMENT_CREATED event and the refactor of event type constants to ClassyEnum class.

class EventType < ClassyEnum::Base
  # @abstract
  # @return [String]
  def digest_title
    raise NotImplementedError, "must implement #{self.class}::#{__method__}"
  end
end

class EventType::ProjectCreated < EventType
  def digest_title
    "Created #{owner.project.name}"
  end
end

# ...
class ConvertEventsToUseEnums < ActiveRecord::Migration
    def up
        say_with_time "Converting to classy_enum" do
            execute <<~SQL.strip_heredoc.strip
            UPDATE events SET event_type = LOWER(event_type)
            SQL
        end
    end

    def down
        say_with_time "Converting from classy_enum" do
            execute <<~SQL.strip_heredoc.strip
            UPDATE events SET event_type = UPPER(event_type)
            SQL
        end
    end
end
SMaxOwok commented 6 years ago

Needs design for:

SMaxOwok commented 6 years ago

I think I'm getting close to a point where it will be useful to know what kind of information to include in the digest emails. Thoughts?

mkgold commented 6 years ago

Some starting thoughts: on [Date/time] [Account name of annotator commenter] left the following [annotation/comment/reply] on [text]:

"[excerpt of annotation/comment"

To view or reply to the entire annotation/comment , click here To view the [project], click here

tsmyre commented 6 years ago

For all of these elements it would be nice if they were linked so the reader|author|admin can click them and engage with them directly, just like they are in the activity pane. A text would open the text, a resource would go to the detail page for that resource, and the annotations/comments would go directly to that place in the text with the thread pane open.

Projects

Reader >> Daily Digest

What's new on {instance_name}? Oh snap, some of the projects you're following were updated. Check it out!

<!--If nothing has happened on a day, I think it's better to simply not send an email, yes? Would we note that in the signup form? -->

<!-- For each project where at least one of the following conditions has changed from the previous day. If a section is empty it shouldn't appear. And any sectin that does appear, should appear with the icons used in the activity feed next to the section title. The icon for resources could double for collections. -->

{project_title_1} {project_authors_1} <!-- include thumbnail from library -->

Texts Added Today {text_title_1} in {category_title} ... {text_title_n} in {category_title}

Resources Added Today {text_title_1} in {collection_title} ... {text_title_n} in {collection_title}

Collections Created Today {collection_title_1} ... {collection_title_n}

Tweets about {project_title} from Today {tweet_body_1} —{username_1} (@{handle_1}) ... {tweet_body_n} —{username_n} (@{handle_n})

Reader >> Weekly Digest

You're presently following {x} projects on {instance_name}. {y} of them were updated this week. Take a look!

<!-- The link text for these elements could be thet project title and take the user to the landing page? full activity page? -->

{a} Texts, {b} Resources, and {c} Collections, were added to {project_title_1}. ... {d} Texts, {e} Resources, and {f} Collections, were added to {project_title_n}.

<!-- If there are only two items in a series, no comma is needed and they can be separated by “and”; if there are three or more, each element should be followed by a comma, with the exception being the last, which would be preceeded by “and” and terminated with a period. I.e., yay serial comma. Elements that weren't updated shouldn't appear. Ditto the last for below.-->

And these projects are burning up the Twitterverse:

<!-- Again the link text would be the project title. -->

{project_title_1} was mentioned {g} times. ... {project_title_n} was mentioned {h} times.

<!-- Possible for this link to go to a Social-only page showing only Twitter results? -->

Author / Project Editor >> Daily Digest

This would mirror the Reader Daily Digest, save the copy would switch from

What's new on {instance_name}? Oh snap, some of the projects you're following were updated. Check it out!

to

The following projects you're an {role_name_1} for on {instance_name} have been updated today:

<!-- If a user is both an author and project editor on an instance, we would want to say something like “... you're an {role_name_1} or {role_name_2} for...” Or, we could separate out into two sections, one for authors and another for project editors. This will apply to the weekly digest below as well.-->

Author / Project Editor >> Weekly Digest

This would mirror the Reader Weekly Digest, save the copy would switch from

You're presently following {x} projects on {instance_name}. {y} of them were updated this week. Take a look!

to

The following projects you're an {role_name} for on {instance_name} have been updated this week:

Annotations/Comments

Author / Project Editor >> Daily Digest

The following comments were made today to projects you're an {role_name} on {instance_name}. Click below to access and engage with them directly or to flag them as inappopriate.

{project_title_1} {time} / {username_1} said {annotation_excerpt_1} on {text_title_1}. ... {time} / {username_n} said {annotation_excerpt_n} on {text_title_n}. ... {project_title_2} {time} / {username_1} said {annotation_excerpt_1} on {text_title_1}. ... {time} / {username_n} said {annotation_excerpt_n} on {text_title_n}.

<!-- The text and project titles would be clickable and take the user to the comment in the text or to the project landing page. This will apply to all of the following as well.-->

Author / Project Editor >> Weekly Digest

This week, the following {annotation|comments} were left on projects you're working on as {role_name} on {instance_name}. Click below to access and engage with them directly or to flag them as inappopriate.

<!-- Same block from daily digest above. -->

Admin >> Daily Digest

The following comments were made today to projects on {instance_name}. Click below to access and engage with them directly or to flag them as inappopriate.

<!-- Same block from daily digest above. -->

Admin >> Weekly Digest

This week, the following {annotation|comments} were made to projects on {instance_name}. Click below to access and engage with them directly or to flag them as inappopriate.

<!-- Same block from daily digest above. -->

zdavis commented 6 years ago

Hey @SMaxOwok can you please remind me where we're at with this? I know you did work on this, but I don't see a pull request.

SMaxOwok commented 6 years ago

It's mostly built out, but I was waiting on feedback about specifically what should be in the emails. I thought @tsmyre's comment above was kind of the jumping off point for people to give their opinions on, since I remember going back and forth a lot about who wanted what.

zdavis commented 6 years ago

Hey @SMaxOwok, I know a lot of work has been done on this, and I'd like to get it in 2.0. Possible? I don't think anyone else is going to add feedback at this point, so perhaps we can go with what @tsmyre proposed?

SMaxOwok commented 6 years ago

Oh man... I can try. Let me get it rebased on master and see what it looks like. I'm not sure how much cleaning up/styling needs to be done.

zdavis commented 6 years ago

If not, it’s not the end of the world. If I had to choose between global backend changes and this, I’d choose global backend changes.

On Tue, Aug 7, 2018 at 3:42 PM Max Ono notifications@github.com wrote:

Oh man... I can try. Let me get it rebased on master and see what it looks like. I'm not sure how much cleaning up/styling needs to be done.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ManifoldScholar/manifold/issues/951#issuecomment-411226235, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPnpbHSt0ScZriajA8ibAUfnFm_uhYTks5uOhfrgaJpZM4TOsD9 .

laelito commented 6 years ago

Hi all -- so we've got some updated email styling to accompany this issue. Check out the attached PDF comp. Emails.pdf

tsmyre commented 6 years ago

I like this. Very clean and to the point. What is intended with the lorem ipsum blocks at the bottom? On pages 1 and 2 there is only one block and then two blocks on pages 3 and 4.

mkgold commented 6 years ago

I agree. Nice work @laelito !

@tsmyre thanks so much for speccing out all of these emails! I really like them all. I'd probably leave out "oh snap!" but otherwise I think this is great.

mkgold commented 5 years ago

Not sure whether to start a new ticket or not, but I've been looking at these reports and I would really love to see whether we can include info on project creator to these emails -- somewhere in the attached screenshot I would love to see something like "by [Project creator name]" so that I know who added the text in question. On a big instance like CUNY's that's useful information -- if it's a trusted user, I barely need to check; if it's someone new to the platform, I may want to take a look

screen shot 2019-02-13 at 9 31 46 pm