When a user is in Simple News list as a subscriber then subscribes again Simple News sends the confirming email with instructions to click to confirm your subscription - in other words it doesn't say "hey you are already subscribed". FYI, when the confirmation is clicked the user doesn't seem to be added again i.e. the total number of subscribers is same before and after.

CommentFileSizeAuthor
#3 fix_already_subscribed.patch3.83 KBberdir

Comments

RoseEuphoria’s picture

I've got the same problem. When a user who is already subscribed, wants to subscribe again, he gets the "normal" subscription confirmation mail. AND the user gets unsubscribed (disappears in the subscription list). He has to click the confirmationlink and subscribe again.

Anonymous’s picture

Priority: Normal » Major

I can confirm this issue for the current dev as well as the 7.x-1.0-beta1 release. It works fine in 7.x-1.0-alpha2.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new3.83 KB

Confirmed and fixed with the attached patch including test coverage.

The problem was that we started tracking unconfirmed subscriptions but we always created/updated the subscription to unconfirmed even if the subscriber was already subscribed. So he actually *wasn't* subscribed anymore :)

berdir’s picture

Status: Needs review » Fixed

Commited and pushed.

miro_dietiker’s picture

:) like

BUT ;-)
Please fix indentation:

+      // Create an unconfirmed subscription object if it doesn't exist yet.
+      if (!isset($subscriber->tids[$tid])) {
+      $subscription = new stdClass();

Anyway, the function simplenews_user_subscribe should return different values if it succeed or not (was already...) or even need mail confirmation.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.