I received a version of my newsletter and at bottom is option to unsubscribe. When clicked it takes me to web site page to confirm unsubscribe but the email address shown there is not mine. Even stupider, when I go and check for this email address it isn't found by your normal admin>people>simplenews filter function. When I look for it using phpmyadmin in database table simplenews_subscriber it finds this email.
So, in summary unsubscribe show wrong email address. This wrong email isn't found by your filter function but is found by direct view of database table.

FYI, this was originally reported to me by a user. I just upgraded to latest .dev but that didn't help. The module is rendered useless by these errors. If I can help let me know. I have been searching for alternative drupal solutions and the only other is newsletter which has potential. Too bad we can't get you both together.

CommentFileSizeAuthor
#15 obvious_bugs_are_obvious.patch2.56 KBberdir

Comments

berdir’s picture

Status: Active » Postponed (maintainer needs more info)
Road Runner’s picture

This is still happening that is when the user clicks the unsubscribe link at the bottom of received email they are shown the wrong address. Can you tell me what the logic is and I'll take a look. How is connection made between the newsletter recipient address and the unsubscribe address shown on the web site page. To try to eliminate this I exported all 18,000 emails then used phpmyadmin and truncated the subscribe and subscription tables then did a mass subscribe. All emails were imported properly and as far as I could tell the tables in database were set up properly.
I am beginning to wonder if this might be related to Domain Access as I am sending this from a subdomain or perhaps size of list or the fact they were all mass subscribed. Anyway any thoughts on this.

Further info. In looking at tables in database some issues. What does a 2 indicate in the Status Field of Simplenews_subscription table - a 1 means subscribed and 0 means unsubscribed. I believe because of this I could not unsubscribe myself (using the page at newsletter/subscriptions) and I got the email saying I wasn't a subscriber but I am and I did receive my own email when I sent it to entire list. BTW, when I make a subscriber inactive on the admin/people/simplenews page they then cannot be found using the filter function on the same page. IMO if the email address is in the database the filter function should return it with appropriate indicators as to its status.

Real confusion Subscribe Unsubscribe, Activate/Inactive
If you can explain this logic I'll try to help.

berdir’s picture

2 means unconfirmed, the user did not click on the confirm link in the mail that was sent to him.

As I said before, you need to give us a way to reproduce this starting with a clean Drupal 7 installation or give us access to your data. Otherwise, we can't fix it.

Road Runner’s picture

I think I found a method for you to test.

Create new newsletter category - enable Subscribe New Account (Default = On), Opt-in/out = Single, Subscription block checked
Place subscription block on page so you can use it
Add a few at least 5 emails using mass subscribe function (I use reroute module so I can test real emails)
Add a subscription using the subscribe block ( I added 2 of my own here to make sure). One of these 2 accounts is registered with site the other has no account on site but is simply a guest.
Send out list making sure the unsubscribe note appears at bottom of each email (Opt in/out does this for you)

Send to list immediately - no Cron (although this doesn't appear to affect the results, I just got sick of having to go click cron)

When you receive these emails click on the unsubscribe message at bottom of each email

The emails that were mass subscribed all show the same unsubscribe email it will be correct for one of them but then repeats for the rest. The one that repeats seems to be the first one in the list when you mass subscribe. Not completely sure of that since I don't know the order you email in (alphabetized, or something else)

The subscriptions that were subscribed using the block have the correct unsubscribe email showing

Hope that helps.

BTW, I am using Simplenews, SMPT Authentication, MailSystem and HTMLmail I am doing this because I need access to a different mail server my host allows me to use unthrottled and I need to email html FYI the Mimemail module similar to HTMLmail doesn't work.

Similar issue When I select test email (rather then send) and include an email that isn't subscribed - the test email is sent OK but the Unsubscribe link when clicked shows junk on the page I mean lots of strange characters. This isn't a big deal since I am only one using this function but it might be related.

miro_dietiker’s picture

You need to log out before clicking on one of those links.

As long as you're logged in, you will manage your users subscriptions and not the subscription of the recipient.

Road Runner’s picture

Not sure what you are getting at. My subscribers are seeing the wrong address when they try to unsubscribe. I'm just trying to replicate the situation they are seeing, they have told me over and over that when they try to unsubscribe by clicking the link provided at the bottom of each email the wrong email is shown to them. After all what difference does my log in status make to them. If what you are suggesting is I can't mimic the problem then I'll try logging out and see what happens. Thnx, I'll post again when I have some time tomorrow.

Edit Update: Again not sure why you think logging out would change anything I tried it anyway. Same list email with same set up as before. All emails are wrong when unsubscribe ink is viewed or clicked.

berdir’s picture

How are you embedding the unsubscribe link?

Are you using the token or custom PHP code?

Can you post your footer template?

This sounds like a caching issue to me. By default Simplenews caches the built body and footer with two exceptions:

- If the mail address belongs to a user, Simplenews switches to that user and disables caching, as it might contain personalized information.
- Tokens are by default applied on the cached content.

For testing, try to disable caching completely using the new configuration option on the Mail settings page.

Road Runner’s picture

How are you embedding the unsubscribe link? Simple News embeds it for me

Are you using the token or custom PHP code? No, neither

Can you post your footer template? Not using footer template

This sounds like a caching issue to me. By default Simplenews caches the built body and footer with two exceptions: Good catch heh heh

- If the mail address belongs to a user, Simplenews switches to that user and disables caching, as it might contain personalized information.
- Tokens are by default applied on the cached content.

For testing, try to disable caching completely using the new configuration option on the Mail settings page.

I disabled all caching the one that SimpleNews uses in Newsletter>Settings>Sendmail seems to be culprit. I disabled and correct unsubscribe addresses are shown. When I re-enabled the incorrect repeating emails are shown.

berdir’s picture

You are always using the footer template, you just might not override the default one. You can not not use it :) Because that is where the unsubscribe link comes from. And by default, the link is a token (something like [simplenews-subscriber:unsubscribe-url]).

If that is what you mean with "the test email is sent OK but the Unsubscribe link when clicked shows junk on the page I mean lots of strange characters." then that is perfectly fine and the expected behavior. If it is something different, then please provide an example.

It is also possible that this is some issue that only happens in combination with HTML Mail. You might want to try and temporarly disable that module to see if that error still occurs (with caching enabled of course, because you want caching as it's a considerable performance boost when you are sending 18k mails...).

As I said above, this should work perfectly fine and does so in our tests, which cover exactly this.

jlmainguy’s picture

Hi,

I'm having the same issue, or something quite like it.

I send my newsletter to multiple emails, but the "unsubscribe" link in every email provides the same link, for unsubscribing the same address.

I tried disabling the send mail cache and it worked, the unsubscribe links seemed all right in every email, now offering an unsubscribe link for the current receiver's address.

I then tried disabling the module, emptying caches, re-enabling the module, re-enabling the module's cache, and the same issue just came back.

berdir’s picture

How are you embedding the unsubscribe link? See #7-9...

erkka’s picture

Hello,

Simplenews seems superb! I also encountered this issue with false unsubcribe links.

I have a fresh install of Drupal 7 and Simplenews module v. 7.x-1.0-beta1+11-dev, and testing my newsletter with bunch of 14 subcribers. Vast majority of them don't have an account on my site, ie. from Drupal point of view they are anonymous users whom just subcribe to the newsletter. (if I understand correctly, I'm rather new to Drupal)

If I select "Cached content source" from the settings, and send a newsletter, my subribers get a wrong unsubcribe link. But with "No caching" the links are correct.

I haven't touched the footer template, and I'm using "plain" format with no Mime Mail or HTML mail modules installed. So, the footer template used is:

-- <?php print $unsubscribe_text ?>: [simplenews-subscriber:unsubscribe-url]

I'm willing to co-operate as much as I can to help towards resolving this issue. Anything more you need to know?

miro_dietiker’s picture

OK, great if you can reproduce it. :-)

erkka, please contact me or Berdir via profile contact link.

Would be great to get access to your test system or to provide us a dump of it...

erkka’s picture

Mail sent. I hope we get this solved, as I really like Simplenews.

berdir’s picture

Priority: Normal » Critical
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new2.56 KB

Oh wow. I have no idea why I haven't spotted this before but it's quite obvious now. There are two bugs here.

First, we're saving the footer with the wrong cache key, which overwrites the tokens with the actually replaced versions. And second, the List-Unsubscribe header was completely borked too.

This should fix and comes with tests so that this never happens again :)

erkka’s picture

Thank you very much!

Now it seems to work OK.

berdir’s picture

Status: Needs review » Fixed

Ok, commited.

Status: Fixed » Closed (fixed)

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