Seite 1 von 1

Using customer module to store newsletter subcriptions

Verfasst: Mi 30. Sep 2009, 19:55
von Bonus Media
Hi there,
Could anyone tell me if it is possible to make an double opt in form were the information is stored inside the customermodule instead of using a CSV file. In this way I could use more fields for subscribing. I found in the <we:addDelNewsletterEmail> the option type="customer", but found no documentation about it.

I don't want to use this for excisting customers. Just for newsletter subscription.

Thanks in advance for your help

Jorg
Bonus Media

Re: Using customer module to store newsletter subcriptions

Verfasst: Mo 7. Dez 2009, 09:48
von haydi
Did you find it out?

I do know that it is possible use information/inputs of the customer module within the newsletter module.
But I don't know if it is possible for the subscription too... sorry.

I made the double opt-in without we-Tags. Stored the entries in an own table. I thought an still think that it is the lightweightest version for me...

Re: Using customer module to store newsletter subcriptions

Verfasst: Mi 16. Dez 2009, 00:48
von WBTMagnum
Hi Jorg,

Yes, that's definitely possible. For this case we use the following code, after the data from the subscription form has been validated:

Code: Alles auswählen

<we:addDelNewsletterEmail type="customer" doubleoptin="true" mailid="$newsletterMailID" subject="$newsletterSubject" from="$newsletterSenderMail" id="$confirmPage" />
          
<we:ifSubscribe>
  <we:ifDoubleOptIn>
    <p>A mail has been sent to <we:var type="global" name="WE_NEWSLETTER_EMAIL">! To confirm you subscription, please follow the instructions in this e-mail.</p>
  <we:else />
    <p>Your e-mailaddress <we:var type="global" name="WE_NEWSLETTER_EMAIL"> has been subscribed successfully!</p>
    <?php
      /* Manually add user to a newsletter group */
      $query = "UPDATE tblWebUser SET Gruppe='".$GLOBALS['newsletterGroup']."' WHERE Username='".$GLOBALS['WE_NEWSLETTER_EMAIL']."'";
      $result = $GLOBALS["DB_WE"]->query($query);
    ?>
  </we:ifDoubleOptIn>
<we:else />      
  <we:ifEmailExists>
    <?php $errors['sub_email'] = 'The e-mail ('.$_REQUEST['we_subscribe_email__'].') ist already subscribed!'; ?>
  <we:else />
    <we:ifEmailInvalid>
      <?php $errors['sub_email'] = 'Invalid e-mail ('.$_REQUEST['we_subscribe_email__'].')'; ?>
    <we:else />
      <?php $errors['sub_email'] = 'A problem has occurred while subscribing your e-mail ('.$_REQUEST['we_subscribe_email__'].')! Please contact our support/webmaster/...!'; ?>
    </we:ifEmailInvalid>
  </we:ifEmailExists>
</we:ifSubscribe>
HTH,
Sascha