Gossamer Forum
Home : Products : Links 2.0 : Customization :

Admin receives email when a link is waiting to be validated

Quote Reply
Admin receives email when a link is waiting to be validated
Is there a way for Admin to be informed by email each time a new site is proposed to be validated ? Tanx if u can help. Wink
Quote Reply
Re: [jigme] Admin receives email when a link is waiting to be validated In reply to
If you mean when someones uses the ADD page, yes, this is the default setup for Links. There is an option in links.cfg, see what you have it set to...


Leonard
aka PerlFlunkie
Quote Reply
Re: [PerlFlunkie] Admin receives email when a link is waiting to be validated In reply to
Crazy : i don't find it !!?Unsure ok, there's '$db_email_add' which is to notify visitors, but i don't find anything to notify the administrator when 'add.cgi' is used by a visitor ... can u help me further (sorry if i m blind)
Quote Reply
Re: [jigme] Admin receives email when a link is waiting to be validated In reply to
oops...Blush

Right, the option is for the person to be notified when their link is validated. You should, however, get an email whenever someone submits a link. Do you get email from the script for anything else? Meaning, is the mail server and admin address set correctly in links.cfg? There is this in add.cgi, the green is the message you should get:

# Send the admin an email message notifying of new addition.
&send_email;
# Send the visitor to the success page.
&site_html_add_success;
}
else {
&site_html_add_failure($status);
}
}
sub send_email {
# --------------------------------------------------------
# Sends an email to the admin, letting him know that there is
# a new link waiting to be validated. No error checking as we don't
# want users to see the informative &cgierr output.

# Check to make sure that there is an admin email address defined.
$db_admin_email or &cgierr("Admin Email Address Not Defined in config file!");
my $to = $db_admin_email;
my $from = $in{$db_cols[$db_contact_email]};
my $subject = "Addition to Database: $in{'Title'}\n";
my $msg = qq|
The following link is awaiting validation:
Title: $in{'Title'}
URL: $in{'URL'}
Category: $in{'Category'}
Description: $in{'Description'}
Contact Name: $in{'Contact Name'}
Contact Email: $in{'Contact Email'}

Remote Host: $ENV{'REMOTE_HOST'}
Referer: $ENV{'HTTP_REFERER'}

To validate, please go to:
$db_script_url

Sincerely,

Links Manager.
|;
# Then mail it away!
require "$db_lib_path/Mailer.pm";
my $mailer = new Mailer ( { smtp => $db_smtp_server,
sendmail => $db_mail_path,
from => $from,
subject => $subject,
to => $to,
msg => $msg,
log => $db_mailer_log
} ) or return;
$mailer->send or return;


Leonard
aka PerlFlunkie