OFFERING PRIVATE EMAIL LIST CAPTURE TO YOUR MEMBERS - Jun 22nd, 2011
|
Want to allow your members to create independent, private, double opt in email lists.
It’s easier than you think.
Building on two recipes, LIMITING ACCESS TO RECORDS BY AUTHOR and DOUBLE OPT IN MAIL LIST IN CMSB, here’s how:
CONCEPT: In my situation, the visitor was looking at the detail page of a record that was created by specific member. That page also contained my email signup form.
The process I used was to query the createdByUserNum field of that detail page record, and use that value to populate the createdByUserNum field of my “email_signup” table.
To display only the email addresses that belong to that member on an email list page, I restricted the records displayed to only the email address records that were tagged with the member’s user number.
CODE CHANGES First, create an email_signup table following he instructions in the DOUBLE OPT IN MAIL LIST IN CMSB recipe.
Then add the active error checking and execution code, and the email signup form to the detail page referenced above.
On that detail page, above the error correction and execution code add the following to define the variable: $owner :
<?php $owner = $your_detail_page_tableRecord['createdByUserNum'] ?>
And in the //add record section, change
createdByUserNum = '0',
to:
createdByUserNum = '$owner',
Now, each email_signup table record will be tagged with the user number of the member who created the record displayed on the detail page.
The last part is to limit the email addresses displayed to only those email_signup records attributed to that member.
Here are the simple changes to the email list display page described in the DOUBLE OPT IN MAIL LIST IN CMSB recipe.
In both foreach loops, add:
<?php if ($record['createdByUserNum']== @$CURRENT_USER['num']): ?>
Below the:
<?php if ($record['hidden'] == 0 && $record['confirmed'] == 1): ?>
And add an <?php endif ?> after each existing <?php endif ?>
That should do it.
|
The materials on this web site have been created for use with CMS Builder content management software. CMS Builder software is published and licensed for use by InteractiveTools.com. Please contact
Interactive Tools for information on the downloading of the software or the purchasing of licenses.