uc_newsletter issues

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

@andrews501
I don't believe that works, if you look at the code of simplenews_forms($form_id, $args) you will find this works only with simplenews forms. In simplenews 2.0 alpha the function simplenews_block_form() in simplenews.subscriptions.inc in a subdirectory (included only when needed) so you would have to do a
module_load_include('inc', 'simplenews', 'includes/simplenews.subscription'); before calling simplenews_block_form().

However, because this module is unsetting the submit handler for the block it is pulling from simplenews there seems little benefit in using it rather than creating the pane from scratch (correct me if I'm wrong Will).

Also I found the following issues with this module
Because the subscribe action is being done in the 'save' part of the hook_order, the newsletter subscribe email is sent every time the submit button is pressed, regardless of whether any forms errors occurred. So if it took 5 attempts to get the validation right, the cust would receive five emails!
The subscribe action is not stored so if you leave the order (that has been saved status= incheckout) and come back to it later, your last choice is forgotten (because it wasnt saved) - minor point.

I am new to module creation but I created my own around the basis of this module but with an attempt at using the single/double confirm methodology of simplenews 2 (alpha). I also use the $op ='submit' case of hook_order so it only occurs after all validations have been made (should this be made to be the very last hook_order processed in case another hook_order submit want to reject the order?) And, I put the action in the data section of the order so it is saved with the order (I think. I dont use the review page.) oh and finally, I allow unticking of the box to unsubscribe the user if already subscribed.

It seems to work how I need it to, any one else like to try it please let me know of any issues.
I have uploaded my effort as a new module uc_subscribe

Subscribe to Newsletter By: willeaton (10 replies) Tue, 11/03/2009 - 05:20