Page 1 of 1

adding a new variable to messages.

PostPosted: Tue Jul 06, 2010 3:08 am
by Vitality
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

Re: adding a new variable to messages.

PostPosted: Tue Jul 06, 2010 4:33 pm
by Admin-BS
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

Re: adding a new variable to messages.

PostPosted: Wed Jul 07, 2010 9:45 am
by Vitality
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?

Re: adding a new variable to messages.

PostPosted: Fri Jul 09, 2010 6:54 pm
by Admin-BS
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.