adding a new variable to messages.

Discussion related to NP Subscriber Pro.

adding a new variable to messages.

Postby Vitality » Tue Jul 06, 2010 3:08 am

heyy, currently when you send a message out you can use: <NAME> or <UNSUBSCRIBE_LINK>
im trying to add one with <GAMERTAG>. i understand where the code is at in the subscriber.cgi i just dont know how to write it :/

if im right.. they are where
# PLAIN TEXT SEND
is located


and yes, i have an input on my form which records the "gamertag" of the user.

if someone could help me with the code that'd be great
Vitality
 
Posts: 4
Joined: Mon Jul 05, 2010 2:40 pm

Re: adding a new variable to messages.

Postby Admin-BS » Tue Jul 06, 2010 4:33 pm

All you need to do is go to the admin.cgi script and go under "Add Slots." Then you can add any number of additional fields which can be inserted into outgoing messages.

There is some additional information in the manual:
http://npscripts.com/subscriber-pro/manual/slots.html
Admin-BS
Site Admin
 
Posts: 99
Joined: Sat Dec 31, 2005 6:52 pm
Location: USA

Re: adding a new variable to messages.

Postby Vitality » Wed Jul 07, 2010 9:45 am

thanks! that worked.

and also im trying to send a "thank you" message to the user that subscribes when they subscribe. it worked when i had e-mail confirmation enabled and i had the code in activate.cgi... but since e-mail confirmation is disabled, i now have the code in subscriber.cgi near the bottom of sub addmail.
here is what i have:

Code: Select all
# Now count total... If >= to notify number, email the administrator...
open(NOTIFY,"$list/.notify");
while(<NOTIFY>) {$count++;}
close(NOTIFY);


# Send a Thank you for Subscribing to the Newsletter
$from = "$admin";
$to = "$newmail";
$subject = "Thank you for subscribing to the ________ Newsletter!";
&mail;

print MAIL "Hey, thanks for subscribing to the ________ Newsletter!\nVisit the link below to _________\n\nhttp://test.com";

close(MAIL);

if ($count >= $notify) {

# EMAIL THE ADMINISTRATOR HERE


but i dont receive an e-mail after subscribing. is something wrong with the: $newmail that i've used?
Vitality
 
Posts: 4
Joined: Mon Jul 05, 2010 2:40 pm

Re: adding a new variable to messages.

Postby Admin-BS » Fri Jul 09, 2010 6:54 pm

Sorry for the slow reply...

The code looks fine to me. I'm not sure what could be causing it. You may want to open up the file "common" in the root directory and find the "mail" subroutine. Assuming you're using sendmail, look for the following lines:
Code: Select all
#open(MAIL,"+>TESTMAILFILE.txt");
open(MAIL, "|$mailprog -t $mail_commands") || die "can't open sendmail";


You may wish to uncomment the first line, and comment the second. This should create that TESTMAILFILE.txt file with the contents of what otherwise would be sent to sendmail. This might give a clue to the problem if something looks off.
Admin-BS
Site Admin
 
Posts: 99
Joined: Sat Dec 31, 2005 6:52 pm
Location: USA


Return to Subscriber Pro

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron