Gossamer Forum
Home : Products : DBMan : Customization :

Archive mod question

Quote Reply
Archive mod question
Hi! Just one quick question on the archive mod. I'm trying to get it to email to the user that his record has been archived. I have tried to do the coding my self by copying the following to sub_html_archive_success:

if ($rec{'Status'} eq 'Graduated') {
open (MAIL, "$mailprog") or &cgierr("unable to open mail program");
print MAIL "To: $rec{$db_email_field}\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Your Record at $html_title has been archived by the administrators\n\n";
print MAIL "Congradulations! You have graduated from AES Academy. Your record has been archived for future references.\n";
print MAIL "Your record at $html_title was archived by $rec{'Realname'}:\n\n";
foreach $column (@db_cols) {
print MAIL "$column: $rec{$column}\n";
}
print MAIL "\n\n";
close MAIL;
}
else {
open (MAIL, "$mailprog") or &cgierr("unable to open mail program");
print MAIL "To: $rec{$db_email_field}\n";
print MAIL "From: $admin_email\n";
print MAIL "Subject: Your Record at $html_title has been archived by the administrators\n\n";
print MAIL "I'm sorry to inform you that you have not met the graduation requirements of AES Academy. You record has been archived for furture references. We hope that you will join us again.\n";
print MAIL "Your record at $html_title was archived by $rec{'Realname'}:\n\n";
foreach $column (@db_cols) {
print MAIL "$column: $rec{$column}\n";
}
print MAIL "\n\n";
close MAIL;
}

But it just isn't email to the user. I assume that it's because the record is no longer in the database but was transferred to another database. Do you have any idea as to how to do what I need it to do?

Also, do you know of any scripts that will autogenerate a random number and then write it to the .pass file. The random number need not be encrypted nor need it need to be track. Actually, I was thinking of using the random number that would be generated automatically when a user sign up. Of course the user won't be able to see the number. This number would then be sent to the user via email once his record has been validated by admin.

The purpose of this number would be to add security to the forget password mod. Instead of only asking the user to enter in his email or username, he would also need to enter the random number in order for the new password to be sent to him.

I hope this isn't too much a bother.

Julian
Quote Reply
Re: Archive mod question In reply to
Where did you place the mailing code?

Once I get to feeling a little better, I intend to get back to my list of mods to write, which includes an "approve signup" mod. Right now, my brain is only running on one cylinder at best. Too much sun. Not enough rain. I hate summer.

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Archive mod question In reply to
Sorry to hear that you are feeling a bit under the weather. Hope you are feeling better soon.
Where I placed the mailing code is in the sub html_archive_sucess.


Julian
Quote Reply
Re: Archive mod question In reply to
In Reply To:
Sorry to hear that you are feeling a bit under the weather. Hope you are feeling better soon.
Yes, "under the weather" is exactly the right term for it. It is completely because of the weather. Today's a little better. We have rain!!!!! Laugh

You need to put your mail routine in the subroutine that actually does the archiving.

Put it in sub archive_records, just after

Code:

print ARC "$line\n";
close ARC; # automatically removes file lock
For your "To" email address, use $data[the number of your email field].

JPD
http://www.jpdeni.com/dbman/
Quote Reply
Re: Archive mod question In reply to
Thanks. I'll tyr it out. I bet that it's going to work. :)

Julian
Quote Reply
Re: Archive mod question In reply to
One more thing, I was trying to add a link that would point the user to where the archive record is in the email that would be sent to him once the record is archived. However, I was unable to do so as it gave the 500 Internal Error message saying that there is a missing operator in one of the lines I added.

Please help me out.

print MAIL "To view your record, please go to <A HREF="$db_script_url?db=archive&uid=$db_uid&view_search=1">Search Archives</A>;\n";

Julian
Quote Reply
Re: Archive mod question In reply to
print MAIL qq|To view your record, please go to <A
HREF="$db_script_url?db=archive&uid=$db_uid&view_search=1">Search Archives</A>;\n|;

JPD
http://www.jpdeni.com/dbman/