Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Newsletter subscription management

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 09-22-2002, 03:56 PM
 
martinp martinp is offline
 

Newbie
  
Join Date: Sep 2002
Location: USA
Posts: 4
 

Default Newsletter subscription management

I would like to be able to manage the newletter subscription file. Apparently it is stored in MySQL table Б─≤maillistБ─≥. I can not access it via X-Cart, only with help of mysql tools. Any suggestions how to do it?
I am not too skilled in the PHP stuff, I can only hack things that some smart people write.
Martin
Reply With Quote
  #2  
Old 09-22-2002, 05:00 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

How do you mean "manage" ? The best thing to use phpMyAdmin, just search google for it.

hth.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #3  
Old 10-10-2002, 06:55 AM
 
brijmin brijmin is offline
 

Member
  
Join Date: Oct 2002
Posts: 27
 

Default

I agree with "martinp". There should be some way to do the following...

View the members.
Delete members.
Delete old newletters.
See a total number of subscribers.

And yes phpMyAdmin will do all this. Download it if your host does not already have it installed for you.

There was no clear way for subscribers to optout of the newsletter either; unless you count the one screen that shows one small link to unsubscribe just after you joined.

The news letter should send out an email to the email that subscribed; telling the user that he/she just joined a newsletter. The same goes for the unsubscribe.

I have added an unsubscribe to the help menu. To see click optout.

If you are interested here are the steps...

1. Create a optout.tpl file in your help directory. Paste the code below in that file.
Code:
{* $Id: optout.tpl,v .5 2002/10/10 06:55:20 lucky Exp $ *} {capture name=dialog} We Respect Your Privacy, and Pledge not to Abuse This Privilege. To Stop Future Mailings, Type in your email address and then Click the Link Below to be Removed Instantly. <form action="../mail/unsubscribe.php" method=get name=unsubscribeform> <input type="text" name="email" size="10"> {include file="buttons/unsubscribe_menu.tpl"} <input type=hidden name=redirect value="{$redirect}"> </form> {/capture} {include file="dialog.tpl" title=$lng.lbl_unsubscribe content=$smarty.capture.dialog extra="width=100%"} {capture name=dialog} This free monthly publication is sent ONLY to those who have subscribed. This newsletter is completely 100% opt-in and uses only completely ethical means in which to gain new subscribers. <form action="../mail/subscribe.php" method=get name=subscribeform2> <input type="text" name="email" size="10"> {include file="buttons/subscribe_menu.tpl"} <input type=hidden name=redirect value="{$redirect}"> </form> {/capture} {include file="dialog.tpl" title=$lng.lbl_subscribe content=$smarty.capture.dialog extra="width=100%"}

2. Add this code to your help/index.tpl file.
Code:
{elseif $section eq "optout"} {include file="help/optout.tpl"}

3. Add this code to your help/genral.tpl file.
Code:
<tr><td height="10" width="1" class="TableCenterSmallText" colspan=4></td></tr> <tr> <td valign="top" height="15" class="TableCenterSmallText">{$lng.lbl_unsubscribe} / {$lng.lbl_subscribe} {include file="buttons/go.tpl"} </td> </tr>

I am by no means an expert on all this, but it works for me. It all seems stright forward once you sit down and look at the way x-cart works. BTW this is my first experience playing with Smarty...
Reply With Quote
  #4  
Old 10-12-2002, 05:44 PM
 
POSDepot POSDepot is offline
 

Advanced Member
  
Join Date: Sep 2002
Posts: 52
 

Default

Great idea.

I used your code but I get an error when calling "buttons/unsubscribe_menu.tpl"

I guess I have to create this template but I'm not sure of the code that goes there.

Can you share it with us?

Thanks
Randy
Reply With Quote
  #5  
Old 10-12-2002, 07:12 PM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

Code:
<font class="TableCenterCustomerForm">unsubscribe [img]{$ImagesDir}/GOboutonWhiteBkg.gif[/img]</font>

Could also add the unsubscribe text to the languages but im lazy
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #6  
Old 10-13-2002, 07:48 AM
 
brijmin brijmin is offline
 

Member
  
Join Date: Oct 2002
Posts: 27
 

Default

Oops... I forgot about adding the "buttons/unsubscribe_menu.tpl"

Step 4.

Create a new Template file called unsubscribe_menu.tpl in your buttons directory. Place the code below in that file.

Quote:
<font class="TableRightNewsContent">{$lng.lbl_unsubscrib e}</font>[img]{$ImagesDir}/GObouton.gif[/img]

Its just like the subscribe_menu.tpl the only difference was the smarty code changed from {$lng.lbl_subscribe} to {$lng.lbl_unsubscribe}. The work unsubscribe was already in my Language files, I think...

Option B world be to use the code BOOMER used in the new buttons/unsubscribe_menu.tpl file.

Quote:
<font class="TableCenterCustomerForm">Unsubscribe [img]{$ImagesDir}/GOboutonWhiteBkg.gif[/img]</font>

Enjoy,
b.
__________________
If at first you don\'t succeed, cover up any evidence you ever tried.
Reply With Quote
  #7  
Old 10-13-2002, 08:49 AM
 
ATKOgirl ATKOgirl is offline
 

X-Adept
  
Join Date: Sep 2002
Posts: 448
 

Default

Hi Everyone,

It would also be nice to be able to differentiate subscribers on the mailing list -- customers who have registered and subscribed vs. visitors who have subscribed only, not registered.

ATKOgirl
Reply With Quote
  #8  
Old 10-13-2002, 02:56 PM
 
POSDepot POSDepot is offline
 

Advanced Member
  
Join Date: Sep 2002
Posts: 52
 

Default

Thanks for the code.

Unfortunately I get an error on my site when I use the code and also on your site.

I tried your link on 2 different systems and IE6 and Netscape 7.

The form works if you enter an email address and press the enter key, but generates an error if I use the mouse to press the submit link.

Anone else getting this error?

Thanks
Randy
Reply With Quote
  #9  
Old 10-13-2002, 07:11 PM
 
brijmin brijmin is offline
 

Member
  
Join Date: Oct 2002
Posts: 27
 

Default

Damn I hate it when that happens... You are 100% correct. and so it the code Now. I have fixed the code above to work correctly. There were 2 things wrong with it.

1. the javascript in the unsubscribe link was incorrect. The name of the form and the document submit needs to be the same.
2. there can be only one javascript:document.subscribeform.submit() per page otherwise your browser gets confused.

It's all good now. Just copy and paste the code again in your optout.tpl file...

See ya on the flip side,
b.
__________________
If at first you don\'t succeed, cover up any evidence you ever tried.
Reply With Quote
  #10  
Old 10-15-2002, 07:00 AM
 
POSDepot POSDepot is offline
 

Advanced Member
  
Join Date: Sep 2002
Posts: 52
 

Default

Works like charm now.

Thanks a lot!!

Randy
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:19 PM.

   

 
X-Cart forums © 2001-2020