Gossamer Forum
Home : Products : DBMan : Customization :

Upload Mod Email Notification

Quote Reply
Upload Mod Email Notification
I am using the "old" upload mod and it is working fine - however, I am trying to get DBMan to send the admin an email whenever someone uploads a file - I know the code goes in the Upload_Success in the html.pl - however, I want the email to give the userID when a file is uploaded.

Here is what I have - but the userID does not print out in the email.
Code:
sub html_upload_success {
# ---------------------------------------------------

&html_print_headers;

print qq|
<html>
<head>
<title>$html_title: Upload Success</title>
</head>
<body background="http://melhialu.hostme.com/images/bg.gif" LINK="#008000" VLINK="#008000">
<center>
<table border=1 bgcolor="#FFFFFF" cellpadding=5 cellspacing=3 width=590 align=center valign=top>
<tr>
<td colspan="2" bgcolor="#008000">
<FONT FACE="MS Sans Serif, arial,helvetica" size=1 COLOR="#FFFFFF">
<b>$html_title: Upload Success</b>
</font>
</td>
</tr>
<tr>
<td>
<p><center><$font_title><b>Upload Success</b></font></center><br>
<P><Font face="Verdana, Arial, Helvetica" Size=2>Your file was successfully uploaded:</FONT>
|;
&html_record_long(&get_record($in{$db_key}));
print qq|</font></p></td></tr></table>|;
&html_footer;
print qq|</td></tr></table></center></body></html>|;

open (MAIL, "|$mail_prog -t");
print MAIL "To: support\@cocoahighalumni.com\n";
print MAIL "Reply-to: support\@cocoahighalumni.com\n";
print MAIL "From:$in{'UserID'}\n";
print MAIL "Subject: Picture Uploaded !\n";
print MAIL "\n\n";
print MAIL "The Following User: $in{'UserID'} has uploaded a picture. \n" ;
print MAIL "in the MHS ALUMNI database. \n" ;
print MAIL "\n\n";close (MAIL);
}

Thanks!
----------------------------
donm
Quote Reply
Re: Upload Mod Email Notification In reply to
Have you tried replacing $in{'Userid'} with $rec{'Userid'}??

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Upload Mod Email Notification In reply to
Instead of

Code:
print MAIL "The Following User: $in{'UserID'} has uploaded a picture. \n" ;

try

Code:
print MAIL "The Following User: $db_userid has uploaded a picture. \n" ;

You can always count on the $db_userid being available for logged in users. The old upload mod doesn't pass the UserID field back to the script, so there isn't anything in either $in{'UserID'} or $rec{'UserID'}.


------------------
JPD






Quote Reply
Re: Upload Mod Email Notification In reply to
Thanks - the $db_userid worked great !

---------------
donm