Gossamer Forum
Home : Products : DBMan : Customization :

E-mail notification

Quote Reply
E-mail notification
Is it possible to supplement the script so that I get an e-mail notification when a record is updated? I guess the ideal would be a single, short e-mail as a user logs off if any fields were updated.

TIA,

Andy
Quote Reply
Re: E-mail notification In reply to
The easier way to do it is to have an email sent to you from the html_modify_success subroutine in html.pl.

If you need help setting up a script to send an email, either search through the forum archives or ask.


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





Quote Reply
Re: E-mail notification In reply to
Thanks, JPD.

On searching thru the archive, I've managed to add a mail routine. Tacked on the end of the html_modify_success sub-routine, it is set out below (including the last lines of the previous sub-routine for info).

I've tested it a few times, but have not received a mail. Could you please look it over and help me!

TIA,

Andy

* * *

</body>
</html>
|;
open (MAIL, "|/usr/lib/sendmail -t");
print MAIL "To: $in{'me@mydomain.com'}\n";
print MAIL "From: $in{'server@mydomain.com'}\n";
print MAIL "Subject: $in{'Record modified'}\n";
print MAIL "\n\n";
print MAIL "$in{'$db_uid'}\n";
print MAIL "\n\n";close (MAIL);
}
Quote Reply
Re: E-mail notification In reply to
First off, are you sure that your path to sendmail is correct? Some servers have it in different places.

Second, your email addresses should not be "$in{...}" variables.

Set it up like this:

Code:
open (MAIL, "|/usr/lib/sendmail -t");
print MAIL "To: me\@mydomain.com\n";
print MAIL "From: server\@mydomain.com\n";
print MAIL "Subject: Record modified\n";
print MAIL "\n\n";
print MAIL "$db_userid\n";
print MAIL "\n\n";
close (MAIL);

I think this will give you what you want.

I do like it, though, when people give it a try, even if it doesn't work. Smile

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





Quote Reply
Re: E-mail notification In reply to
Yes, that works just fine.

Thanks for all your help,

Andy