Gossamer Forum
Home : Products : DBMan : Installation :

is it possible for e-mail the user from DBMan when they create an entry?

Quote Reply
is it possible for e-mail the user from DBMan when they create an entry?
Hi, I've got a new news database set up at http://www.amiga.org/news.shtml . Actually, that's a redirection page, but it's the easiest way to get there.

The db is build using almost standard fields, all the fields are build using the standard type any way, but I'd like to add some features and need your help.

Is there any way for me to be able to provide a thank you e-mail for default users who submit news to the site, ala Links?

It seems rather rude (to me) to ask a user to help us by sending a breaking news story, then not even sending him a "thank you" note.

Any help would be appreciated,


------------------
Wayne Hunt
Amiga.org
http://www.amiga.org

Quote Reply
Re: is it possible for e-mail the user from DBMan when they create an entry? In reply to
Probably the easiest way to do it would be to add a "send email" section to the html_add_success subroutine.

------------------
JPD
Quote Reply
Re: is it possible for e-mail the user from DBMan when they create an entry? In reply to
What I did was add the message into the db.cgi at the very end of sub add_record at the:
&html_add_success;

if ($in{'EMail'}) {

open (MAIL, "|/usr/sbin/sendmail -t");

print MAIL "To: $in{'EMail'}\n";
print MAIL "From: you\@youremail.com\n";
print MAIL "Subject: Thanks for your addition!\n\n";
print MAIL " \n";
print MAIL " \n";
print MAIL "Hi $in{'FirstName'},\n";
print MAIL "blah blah blah \n";
print MAIL " \n";
print MAIL " \n";
close MAIL;
}


I put it right before the:

}
else {
&html_add_failure($status);
}
}
Quote Reply
Re: is it possible for e-mail the user from DBMan when they create an entry? In reply to
Thanks for the replies. I have one question for Norm's reply.

Where does
Quote:
if ($in{'EMail'})

Get the e-mail address from? a Field?





------------------
Wayne Hunt
Amiga.org
http://www.amiga.org

Quote Reply
Re: is it possible for e-mail the user from DBMan when they create an entry? In reply to
Yup. That and FirstName are just hypothetical fields in your db. Use whatever you have in yours. Sorry for not specifying that...