wpsharks / comment-mail

A WordPress plugin enabling email subscriptions for comments.
http://comment-mail.com
GNU General Public License v3.0
8 stars 3 forks source link

Allow multiple subscriptions to the same post with different delivery options #277

Open raamdev opened 8 years ago

raamdev commented 8 years ago

When somebody creates a "replies only"+"instantly" subscription on a post, ​any subsequent "all replies" subscription they create on that post, regardless of the delivery option, will override any other comment subscriptions they created for that post that post​.

The same is true when the new subscription is for a specific comment: we currently wipe away any existing subscriptions that are for the entire post or for the same comment ID. See these two lines.

Example Scenario

Let's say a visitor replies to a specific comment on a post and chooses to subscribe to "replies to my comment" (because they're only interested in responses to their comment inside that specific comment thread) and they choose "instantly" because they want to receive replies to their own comment instantly.

Now let's say they then leave a second comment on that same post, let's say a top-level comment (not a reply to an existing comment), and this time they choose to subscribe to "all replies" and "weekly digest"—they're not interested in being bombarded by all the other discussion; they only want to receive instant notifications for replies to their own comment.

If a subscriber follows these steps, ​the subscription options for that second "all replies" comment will override the subscription settings chosen when posting the first "replies only" comment. So, instead of 2 comment subscriptions (one "replies only"+"instantly" and one "all replies"+"weekly digest"), they will end up with only a single subscription: "all replies"+"weekly digest".

Note: The other scenario where this also occurs is when the new subscription is for a specific comment, we currently wipe away any existing subscriptions that are for the entire post or for the same comment ID. See these two lines.

What should happen instead

We should allow multiple subscriptions on a single post so long as they don't have overlapping delivery options (e.g., you can't have a "replies only"+"instantly" and an "all replies"+"instantly", but "replies only"+"instantly" and "all replies"+"weekly" would be just fine).

We don't want subscriptions with overlapping delivery options because that would create a scenario where a subscriber might receive lots of duplicate emails. However, allowing multiple subscriptions with different delivery options would provide the flexibility for a commenter to receive "replies only" notifications instantly for replies to his or her own comment, while also receiving a digest email for "all replies".