Gossamer Forum
Home : Products : DBMan : Installation :

send mail to admin after new record

Quote Reply
send mail to admin after new record
Hello

I have installed the DBMAN succesfully.

I have installed also the modification from http://www.jpdeni.com/dbman/Mods/

http://www.jpdeni.com/.../email_after_add.txt

to have a message (mail notification) after new record.



Unfortunally, the e-mail-notification which I receiving after every new record it is this...

-----Original message-----

From: master@cool.fm [
mailto: master@cool.fm]

Αποστολή: Τετάρτη, 13 Φεβρουαρίου 2002 1:09 πμ

To: master@cool.fm

Subject: New Record



The following new record has been added to the database:.

--


Where are the data entries?????



Could you hel me ?



Thanks
Quote Reply
Re: [kinisi] send mail to admin after new record In reply to
Try changing:

foreach $col ($db_cols) {
print MAIL "$col -- $rec{$col}\n";

to:

foreach $col($db_cols) {
print MAIL "$col -- $rec{$col}\n";

I think the problem with the original may be the space between $col and ($db_cols).

or try:

foreach $column(@db_cols) {
print MAIL "$column: $in{$column}\n";

Check the FAQ noted below under the section "Email" for other variations which include only sending specific fields.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] send mail to admin after new record In reply to
>>
I think the problem with the original may be the space between $col and ($db_cols).
<<

Perl ignores spaces so it isn't an issue most of the time. The problem is with trying to loop using a scalar. You need to use @db_cols.

Last edited by:

RedRum: Feb 12, 2002, 11:46 AM
Quote Reply
Re: [RedRum] send mail to admin after new record In reply to
Re: [LoisC] send mail to admin after new record - NEW [In reply to] Quote | Reply


>>
I think the problem with the original may be the space between $col and ($db_cols).
<<

Perl ignores spaces so it isn't an issue most of the time. The problem is with trying to loop using a scalar. You need to use @db_cols.


Blush Could you write the full code for this?


Quote Reply
Re: [kinisi] send mail to admin after new record In reply to
Try changing:

Code:
foreach $col ($db_cols) {
print MAIL "$col -- $rec{$col}\n";
}

....to......

Code:
print MAIL map { "$_ : $rec{$_}\n" } keys %rec;
Quote Reply
Re: [RedRum] send mail to admin after new record In reply to
Angelic Ok. That's it!!!!

It's working!!!



Thanks