Different codes to be added to sub validate_records in db.cgi Note that the code is added to the validate records sub and not the subrountine that "validates" whether the form submitted conforms to the rules set out.
Find this line in the sub validate_records in db.cgi:
if ($delete_list{$data[$db_key_pos]} ) {
$delete_list{$data[$db_key_pos]} = 0;
Add this code right after it:
%rec = &array_to_hash(0,@data); # this line allows you to use $rec{'fieldname'} in your message
open (MAIL, "$mailprog") or &cgierr("unable to open mail program");
print MAIL "To: $data[$email_field_number]\n";
print MAIL "From: $admin_email\n";
# you can change the subject line to whatever you want
print MAIL "Subject: $html_title: Record deleted\n\n";
print MAIL "-" x 75 . "\n\n";
# Here's where you create your canned delete message. You can use the $rec{'fieldname'} variables
# just like in sub html_record to include the values of any fields that you'd like to.
# As you define your message, use carriage returns for a newline
$email_message = qq|
Dear $rec{'fieldname'},
I'm sorry, but your application to $html_title is not accepted.
We appreciate your coming by and possibly we can be of assistance to you later.
Sincerely,
Your name here
Your official Title here
$html_title
|;
print MAIL $email_message;
close (MAIL);
Also find this line in the same subroutine:
elsif ($validate_list{$data[$db_key_pos]}) {
$validate_list{$data[$db_key_pos]} = 0;
Add the same codes immediately after the 2 lines above. Note that this part here is to email to the person if you validate his record, the previous one emails if you choose not to validate his record. So you have to make the necessary changes to the email message or else even if you valiadte the person's records he will get an email telling him that his records was not accepted. You wouldn't want that, would you? :)
Julian