Making simplenews subscribe WITHOUT confirmation

thehardings - March 9, 2007 - 05:33

Hi all,
I have a simplenews install which is working fine. But I would like to take away the "confirmation email" that gets posted out. I am hoping that if they subscribe, then they are automatically added to the newsletter and the old "CONFIRMATION email" is now a "WELCOME email" only.

Our reasoning is that sometimes people subscribe, but then fail to click the "confirm subscription" link.
cheers
Dan

simplenews -- how to combine or turn off confirmation emails

kobnim - May 18, 2007 - 23:38

Hello All,

I too am having a similar problem. I'm a Drupal Newbie, so any help would be greatly appreciated!

On my website, a user may subscribe to any of a long list newsletters. Using the simplenews module, it appears that if the user subscribes to say 5 newsletters, then they receive 5 separate confirmation messages, which I'm afraid might be annoying for the user. I would like to modify the module so that either:
(a) it sends a single confirmation message, even if the user subscribes to multiple newsletters. -- or --
(b) it requires no user confirmation at all.

If someone could give me a pointer on how to do this, I'd really appreciate it.
I've looked at the simplenews.module code and see that it could probably be hacked up, but I suspect there's a more elegant approach, and I would hate to use a hacksaw when a tweezer will do. In particular, I'm afraid that if I start making major changes to the module, it will be difficult to maintain when new versions are released.

Thanks,
Mindy

P.S. I am running version 5.1

I support these requests

Valdes@www.drup... - May 21, 2007 - 15:50

Hi,
I was looking for a solution to the problem above described - in an english better than mine I guess ;-)
So, I truly support these requests. I would like not to have the confirmation email (or have the possibility to choose) but when somebody subscribes to the newsletter he/she should receive a welcome newsletter.

A quick hack to remove confirmation emails

frankcarey - May 22, 2007 - 04:56

I just figured this out and wanted to pass along the easy fix:

I read the code and the $confirm flag for the function simplenews_subscribe_user() defaults to true. By simply setting a FALSE default flag, the function will subscribe the user without sending him a confirmation email. I tested it, and looked at the code. It's actually going straight to full subscription without the confirmation step (thank you forward thinking developers) I would like to see this as an added feature in future versions, it should be very easy on a newletter by newsletter or site wide basis. Anyway here are the changes you need to make... note : they will be for ALL newsletters.

This is for simplenews.module,v 1.48.2.3 2007/02/20 17:14:28
If you want just the subscriptions to not be confirmed...change to the following

line 636 - function simplenews_subscribe_user($mail, $tid, $confirm = FALSE) {

line 864 - drupal_set_message(t('Your subscriptions have been updated.'));

If you want just the "un"-subscriptions to not be confirmed as well... change to the following

line 670 - function simplenews_unsubscribe_user($mail, $tid, $confirm = FALSE) {

line 872 - drupal_set_message(t('Your subscriptions have been updated.'));

also, "www.yoursite.com/newsletter/subscriptions" gives all the availible newletters and is availible to anonymous users! took me days to figure this out (I have over 100 newsletters and this was just driving me nuts) cheers

solution

kobnim - May 22, 2007 - 22:38

Thank you!!!
Mindy

Insufficient for later versions

aangel - September 24, 2008 - 16:45

For SimpleNews 6.x-1.0 beta, this line:

// If e-mail belongs to the current registered user, don't send confirmation.
$confirm = $account->uid && $account->uid == $user->uid ? FALSE : TRUE;

Determines the confirmation behavior.

I just hacked mine to read: $confirm = false; // $account->uid && $account->uid == $user->uid ? FALSE : TRUE;

Andre'

Thanks for the comment. Just

tbrix - October 14, 2008 - 20:07

Thanks for the comment. Just what i needed. But removing the confirmation mail poses a new issue. I would like some sort of response to the user when he (un) subscribes. "Thank you for subscribing"... or better, the corresponding text from the admin interface on "Body text of subscribe email". How is that possible?

Thanks
/Thomas

subscribing

corona ronin - January 25, 2009 - 20:42

subscribing

+1

perandre - March 17, 2009 - 08:57

+1

Well, this is not

eme - August 18, 2009 - 10:47

Well, this is not complicated.

A way to do that is to let $confirm with the TRUE value, but just to force the writing of the subscribtion in the database that is controlled by a condition (either mail but no writhing in the database or writing in the database). This is how it is coded for now.

For the coding, I just put as comment the
elseif (!isset($subscription->tids[$tid])) {
line 1001 of my version, in the same function (for the other version, it should be like thirty line after the replacement proposed above.
and of course the } that closes the elseif (1009).

A better coding (this coding removes the condition) would be more changing the elseif into a simple if (didn't test that option).

Then you can personnalise your confirmation message removing the token that links to the confirmation form.

 
 

Drupal is a registered trademark of Dries Buytaert.