I have 2 email notifications setup. One for emailing the user after signup (signup consists of signup form and add_form with more info) with their username and password and the other emailing the user after they enter a record in the records db with the link to their record. It is also setup to email me, the admin, if an email address cannot be found. Well on the email after record added, it works fine, but on the email after signup, it isnt recognizing the email field so I keep getting all the emails instead of the users. This is even though the user just entered their user record via the add form in the users db. Both subs are setup the exact same way, so I dont understand why the notify sub in the records db would be recognizing the email, but the notify sub in the users db which is the main place the email field is stored would not recognize it.
Here is the sub for notifying the user after signup:
open
(MAIL, "$mailprog") or &cgierr("Can't start mail program");
print MAIL "To: $in{'Email'}\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Welcome to StayFlorida.com\n\n";
print MAIL "Thank you for joining StayFlorida.com!\n";
print MAIL "\n";
print MAIL "Your username and password as registered are:\n";
print MAIL "Username: $in{'UserID'}\n";
print MAIL "Password: $in{'Password'}\n";
print MAIL "\n";
print MAIL "Please keep your login details in a safe place.\n";
print MAIL "\n";
print MAIL "If you have not already done so, you may now login to add your property listing(s).\n";
print MAIL "http://www.stayflorida.com\n";
print MAIL "\n";
print MAIL "Should you have any questions regaring your membership,!\n";
print MAIL "please contact webmaster\@wdu.net.\n";
print MAIL "\n";
print MAIL "Sincerely\n";
print MAIL "\n";
print MAIL "StayFlorida.com\n";
close MAIL;
}
else {
open (MAIL, "$mailprog") or &cgierr("Can't start mail program");
print MAIL "To: $admin_email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: StayFlorida.com Signup\n\n";
print MAIL "A new user has been added to StayFlorida.com!\n";
print MAIL "An email address was not recognized by user:\n";
print MAIL "Username: $in{'UserID'}\n";
print MAIL "Password: $in{'pw'}\n";
print MAIL "\n";
print MAIL "Company: $in{'Company'}\n";
print MAIL "Name: $in{'Name'}\n";
print MAIL "Address: $in{'Address'}\n";
print MAIL "Address: $in{'Address2'}\n";
print MAIL "City: $in{'City'}\n";
print MAIL "State: $in{'State'}\n";
print MAIL "Province: $in{'Province'}\n";
print MAIL "Country: $in{'Country'}\n";
print MAIL "Phone: $in{'Phone'}\n";
print MAIL "\n";
close MAIL;
}
This is identical to the email notification after a record is added except for the body of the message. Does anyone have any idea why this wouldnt be working??
Here is the sub for notifying the user after signup:
Code:
if ($rec{'Email'}) { open
(MAIL, "$mailprog") or &cgierr("Can't start mail program");
print MAIL "To: $in{'Email'}\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Welcome to StayFlorida.com\n\n";
print MAIL "Thank you for joining StayFlorida.com!\n";
print MAIL "\n";
print MAIL "Your username and password as registered are:\n";
print MAIL "Username: $in{'UserID'}\n";
print MAIL "Password: $in{'Password'}\n";
print MAIL "\n";
print MAIL "Please keep your login details in a safe place.\n";
print MAIL "\n";
print MAIL "If you have not already done so, you may now login to add your property listing(s).\n";
print MAIL "http://www.stayflorida.com\n";
print MAIL "\n";
print MAIL "Should you have any questions regaring your membership,!\n";
print MAIL "please contact webmaster\@wdu.net.\n";
print MAIL "\n";
print MAIL "Sincerely\n";
print MAIL "\n";
print MAIL "StayFlorida.com\n";
close MAIL;
}
else {
open (MAIL, "$mailprog") or &cgierr("Can't start mail program");
print MAIL "To: $admin_email\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: StayFlorida.com Signup\n\n";
print MAIL "A new user has been added to StayFlorida.com!\n";
print MAIL "An email address was not recognized by user:\n";
print MAIL "Username: $in{'UserID'}\n";
print MAIL "Password: $in{'pw'}\n";
print MAIL "\n";
print MAIL "Company: $in{'Company'}\n";
print MAIL "Name: $in{'Name'}\n";
print MAIL "Address: $in{'Address'}\n";
print MAIL "Address: $in{'Address2'}\n";
print MAIL "City: $in{'City'}\n";
print MAIL "State: $in{'State'}\n";
print MAIL "Province: $in{'Province'}\n";
print MAIL "Country: $in{'Country'}\n";
print MAIL "Phone: $in{'Phone'}\n";
print MAIL "\n";
close MAIL;
}
This is identical to the email notification after a record is added except for the body of the message. Does anyone have any idea why this wouldnt be working??