Gossamer Forum
Home : Products : Links 2.0 : Customization :

Email when Deleting; please help me check code

Quote Reply
Email when Deleting; please help me check code
I am attempting to modify Links so that it will send an email to the user if their link has been deleted. The body of the email will contain various reasons as to why it may have been rejected (porn, warez, invalid url, double email addy submitted, etc.) and it's important to us. Smile

The only things I can find referring to email whatsoever are in links.cfg and admin_html.pl. Am I missing something somewhere?

In links.cfg I added these two fields under Email Notifications:
#Email address to send "deleted link unfairly" letters:
$db_unfair_email = 'unfair@grand-central-chat.net';

and

# Notify visitors automatically when their links are deleted?
$db_email_delete = 1;

In admin_html.pl, under Email Messages, I copied the sub html_validate_email and changed it to apply to deletion, then pasted my changed version after sub html_modify_email. It looks like this:

sub html_delete_email {
# --------------------------------------------------------
# All the link information is stored in %link.
my (%link) = @_;

open (MAIL, "|$db_mail_path") or &cgierr ("unable to open mail: $db_mail_path. Reason: $!");
print MAIL "To: $link{'Contact Name'} <$link{'Contact Email'}>\n";
print MAIL "From: $db_admin_email\n";
print MAIL "Subject: We're sorry, your link has been deleted.\n\n";
print MAIL qq|
Your submission to the Grand Central Search Engine was not accepted, or has been deleted after further
review. The most common reasons for non-acceptance are:

1. Broken link or invalid address.Please check the URL of the submitted site below.
2. No description given for the site.Please enter a description for your submission as the search engine
uses the description to locate sites when a user submits keywords.
3. The content of the submitted site was not appropriate for the GC Search Engine. We do not accept
submissions from porn sites, sites that show nudity (including personal webcams), warez, or sites that
are generally unnaceptable for an all-ages audience. For more information, please read our FAQ
located at:
http://www.grand-central-chat.net/search/faq.html
4. Double email submission (two emails being submitted, causing an error in the database).


Please review your submission to make sure there are no errors that may have caused your submission
to be deleted:

Title: $link{'Title'}
URL: $link{'URL'}
Category: $link{'Category'}
Description: $link{'Description'}
Contact Name: $link{'Contact Name'}
Contact Email: $link{'Contact Email'}

If you find errors, please re-submit the corrected link at our search engine:

http://www.grand-central-chat.net/search

If there were no errors and you have questions as to why your link was deleted, please
contact us with the URL you were trying to submit at the following address:

$db_unfair_email

Should you have any questions, please don't hesitate to ask!

Sincerely,

Raven, webmaster\@grand-central-chat.net
Briteangl, grand central search engine goddess
|;
close MAIL;
}

Is that all I have to do? I feel that I am missing something somewhere, I cannot find in the scripts where the script tells itself to run the html_validate_email or html_modify_email subroutines; and I am horribly worried that I missed something huge. Smile

If this is all I need to do, please tell me! If I missed something, tear me apart!

Thanks in advance,
Raven
Quote Reply
Re: Email when Deleting; please help me check code In reply to
Hi,

Yes, that's already in 2.0, so you might just want to switch. =)

Cheers,

Alex
Quote Reply
Re: Email when Deleting; please help me check code In reply to
PS - This is with Links 1.1 Smile
Is this written into v2.0 already and I should just switch over?

Raven
Quote Reply
Re: [Alex] Email when Deleting; please help me check code In reply to
Hi!

this would be for rejected link oder?

is there a mod to notify linkowner if link was deleted when verify via admin and then verify.cgi finds it broken (404) i delete it and then i would like that linkowner gets mail ... your mail was deleted because 404 ... bla bla

Gregor