Subscribe/unsubscribe pane for ubercart checkout and simplenews

Contrib type: 
Module
Status: 
Bug testing
Moderation: 
Not ready for moderation

Downloads

Latest version: 
1.0.0
Compatibility: 
Ubercart 2.x

Note: I originally called this module uc_subscribe but renamed it when it was pointed out that that name had already been used. The original uc_subscribe can be found at: http://www.ubercart.org/project/subscribe

This module provides an additional pane at checkout for subscribing to simplenews newsletters. It only subscribes to the main newsletter. I created this for my existing active project because neither of the others I could find worked as required.
I use it with drupal 6.20 and ubercart 2.4
I use simplenews alpha2 to use the single/double confirm option but looking at the code I think should work with simplenews 1.3

It calls the subscribe/unsubscribe function of simplenews in hook_order submit (so the confirmation email only happens when checkout is successfull). I use simplenews_block_form_submit($f, $fs) passing it the bits of the $form and $form_states it needs, someone let me know if this is bad practise.

If you are using the review page after checkout then you should look at the comment on line 26 regarding the setting of the default value.

At the moment this should be considered as a starting point as its tested in only my use case.


PreviewAttachmentSize
uc_subscribe_news.zip1.47 KB
goatvirus's picture
Offline
Joined: 12/03/2009
Juice: 57
previous (unrelated) version of uc_subscribe?

Hi there,

sorry for the confusion, but a few months ago I downloaded a module called uc_subscribe, that was on ubercart.org and not in the drupal.org projects list... and it is a totally different module than this!

the one I am looking for has this in the header:

* Ubercart subscriptions module.

*

* By Joe Turgeon [http://arithmetric.com]

* For Sundays Energy [http://sundaysenergy.com]

* Licensed under GPL version 2

* Version 2008/04/11

can you please tell me what happened to that module, and why a module name was re-used, if it has been discontinued?

thanks!
Peter "Fish" Fisera
http://earthangelconsulting.com

jimboo's picture
Offline
Joined: 01/04/2011
Juice: 54
Name change

Thanks for pointing out that the name had been used previously. I just checked the list of contributions and nothing came up. I should have done a full search.
I cant find the uc_subscribe module either.

I have changed the name of my module to uc_subscribe_news.

jimboo's picture
Offline
Joined: 01/04/2011
Juice: 54
uc_subscribe

The original uc_subscribe can be found at http://www.ubercart.org/project/subscribe

goatvirus's picture
Offline
Joined: 12/03/2009
Juice: 57
Re: Subscribe/unsubscribe pane for ubercart checkout and simple

hi Jimboo, thanks for your very prompt response on this!

ironically enough, the original uc_subscribe module seems to have been discontinued (and that is why you were able to re-use the name) but i assure you it does exist (i am using it right now) and it's still a good idea to name yours differently, as you just did. this way there will be no more confusion Smiling

cheers,
Fish
http://earthangelconsulting.com

ps: if anyone is interested in the source code for an improved version of the original uc_subscribe module (a full-featured subscription module for Ubercart 2.x on Drupal 6.x) please let me know and I will provide it.

goatvirus's picture
Offline
Joined: 12/03/2009
Juice: 57
Re: uc_subscribe

re: #3

ah yes, i see what you mean. it IS still online! interesting that the clean URL doesn't end in uc_subscribe, usually it's the same as the module name.

thanks for finding that.

jimboo's picture
Offline
Joined: 01/04/2011
Juice: 54
clean url

There is something amiss with this system. I changed the short name for my mod to uc_subscribe_news and I get a db update error and the project still links to the original url us_subscribe(and gets a page does not exist), but you can find it adding uc_subscribe_news to the url.

Its a bit strange that the project name is the long description and not the module name as the module name does not show up directly under contributions.

eric's picture
Offline
Joined: 11/25/2007
Juice: 82
NOT working

Hi,

I installed this module but it does not seems to work. Not sure what I am missing here.

I can't see the additional pane nor able to find the configuration page.

I tried "Ubercart Simplenews Integration" as well but that does NOT actually work
http://www.ubercart.org/node/13048

I tried "Subscribe to Newsletter" and it WORKS, so I will use that instead....
http://www.ubercart.org/project/uc_newsletter

I am currently using
Ubercart 6.x-2.6
Simplenews 6.x-1.3
as well as other modules....

I think this module may need some work to fix the bug...

Thanks

Chun Ming (Eric) Wong
Managing Director
Portable Electronics Ltd

jimboo's picture
Offline
Joined: 01/04/2011
Juice: 54
Sorry I forgot to change function names

When I changed the module name (to append _news) I forgot to also change the function names.
Have made changes to zip file.

nelslynn2's picture
Offline
Joined: 02/14/2010
Juice: 6
A Bit Confusing to the user in this instance....

When a user, who is already subscribed, checks out with an order and selects to be added to the newsletter list again, they receive a "Unsubscribe" email notification.

jimboo's picture
Offline
Joined: 01/04/2011
Juice: 54
Re: Subscribe/unsubscribe pane for ubercart checkout and simple

Thanks for the info, will take a look!

I am a little confused. The "I wish to subscribe" box is selected by default. If a user checks out without touching the tickbox then they dont receive an email as they are staying subscribed (unless they are previously not subscribed or new, when they will recieve the subscribe email).

if they click the box and take out the tick it will send the unsubscribe email.

Is this not what you are experiencing?

jimboo's picture
Offline
Joined: 01/04/2011
Juice: 54
simplenews and subscribe_news

On my use of this module I use opt/in single for my newsletter so dont use email confirmations.

However I turned it on on (set opt/in to double) on my dev system to test it out. It worked as expected.

BUT I dont use a review order screen, I go straight from checkout to order submitted.

If you use a review order page then In uc_subscribe_news.module line 26 you will see I have a comment about changing the default value from 1 to $arg1->data['subscribe_action'] ?1:0
This is so that the value is saved in the order and so correct at the review page.
Let me know if that doesent work and I will explore further, but Im not well versed on simplenews functionality.

iDonk's picture
Offline
Joined: 12/01/2011
Juice: 3
Double Opt In for registered Users

Hey jimboo!

First of all, thank you for this module, it's exactly what I need! THANK YOU!

The module is working like a charm but i ran into a little issue. When a registered user, who has no subscription yet, places an order and ticks the subscription check mark - he will not get an e-mail with a confirmation link. Although my newsletter is set up with Double Opt In. Now I'm not quite sure if this issue is caused by your module or if it has its origin on the simplenews end.

You might want to check out my site: www.acewell.de - since I'm using a review page u can click through until there.

clavigne's picture
Offline
Joined: 04/25/2010
Juice: 25
Re: Subscribe/unsubscribe pane for ubercart checkout and simple

Thanks for this... much appreciated.