Path

ez projects / cjw_newsletter / forum / general / if user already exists, dir...


If user already exists, direct subscription doesn't work

You need to be logged in to post messages in the forums. New users may register here.

Steven E Bailey

Member since:
27 April 2006

Posts: 54

Tuesday 17 April 2012 3:42:45 pm

I've got a system with multiple newsletters and if an existing user tries to sign up for another newsletter from the subscribe page, it doesn't subscribe them, it sends them a link to the configure page (where, of course, they can subscribe or unsubscribe.) This was a bit unexpected for me, but digging in the code, I found that this is the way it's designed -

In classes/cjwnewslettersubscription.php



            case -1:


               if( $context == 'subscribe' )


               {


                   eZDebug::writeDebug( "checkResult[$checkResult] - CjwNewsletterSubscription::createSubscriptionByArray return false because email already exists" );


                   // break because a newsletter user with email exists


                   return false;


               }


               break;




and in modules/newsletter/subscribe.php



       if ( is_object( $existingNewsletterUserObject) )


       {


           $tpl->setVariable( 'user_email_already_exists', $subscriptionDataArr['email'] );


 

           // $existingNewsletterUserObject->sendSubriptionInfoMail();


           $mailSendResult = $existingNewsletterUserObject->sendSubcriptionInformationMail();




I'm wondering if there is a reason for this logic? I can't think of any right now but it may blindness....

Available for ezpublish troubleshooting, hosting and custom extension development: http://www.leidentech.com
eZCertification | http://ez.no/certification/verify/396111
eZPublishLegacy - eZ Publish Release Mirror | http://ezpublishlegacy.com

Up

You need to be logged in to post messages in the forums. New users may register here.