Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Rejected Link Notification

Quote Reply
Rejected Link Notification
I do not want to send out "your site has been rejected" email auto-reply when I disapprove site submissions. Shouldn't there be a switch to disable "rejected link notification" in the .cfg file?

TIA - davidc
Quote Reply
Re: Rejected Link Notification In reply to
This can easily be fixed...

1) Add the following variable and configuration in your links.cfg file:

Code:
# Email Rejection Letter
$db_email_delete = 0;

This is a flag variable that you can set or reset at anytime. 0 turns off the variable.

2) Then in your admin_html.pl file, replace the following codes:

Code:
my $reason = &load_template ('email-del.txt', \%tmp);

with the following codes:

Code:
if ($db_email_delete) {
my $reason = &load_template ('email-del.txt', \%tmp);
}

Then replace the following codes:

Code:
Email Reason:</font><br> <textarea name="reason-$tmp{$db_key}" rows=4 cols=40>$reason</textarea>

with the following codes:

Code:
if ($db_email_delete) {
print qq|<$font>Email Reason:</font><br> <textarea name="reason-$tmp{$db_key}" rows=4 cols=40>$reason</textarea>|;
}
else {
print qq|<$font>Email Reason: <b>Turned Off</b></font>|;
}

Then replace the following codes:

Code:
Email Reason:</font><br> <textarea name="reason-$tmp{$db_key}" rows=4 cols=40>$db_email_reject</textarea>

with the following codes:

Code:
if {$db_email_delete) {
print qq|Email Reason:</font><br> <textarea name="reason-$tmp{$db_key}" rows=4 cols=40>$db_email_reject</textarea>|;
}
else {
print qq|<$font>Email Reason: <b>Turned Off</b></font>|;
}

3) Then in the db.pl file in the sub validate_records routine, replace the following codes:

Code:
ID: foreach $id (keys %delete_list) {
if ($delete_list{$id}) { next ID; }
elsif (!$in{"reason-$id"}) { next ID; }
elsif (${$links{$id}}{'Contact Email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ | |
${$links{$id}}{'Contact Email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) {
$errstr .= ($errstr, "<li>Email Error: <strong>$id</strong>. Record deleted, but couldn't send rejection letter. Reason: Bad Email addres: '${$links{$id}}{'Contact Email'}'.");
}
else { &html_reject_email (%{$links{$id}}); }
}

with the following codes:

Code:
if ($db_email_delete) {
ID: foreach $id (keys %delete_list) {
if ($delete_list{$id}) { next ID; }
elsif (!$in{"reason-$id"}) { next ID; }
elsif (${$links{$id}}{'Contact Email'} =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/ | |
${$links{$id}}{'Contact Email'} !~ /^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?)$/) {
$errstr .= ($errstr, "<li>Email Error: <strong>$id</strong>. Record deleted, but couldn't send rejection letter. Reason: Bad Email addres: '${$links{$id}}{'Contact Email'}'.");
}
else { &html_reject_email (%{$links{$id}}); }
}
}

That should do it...

BTW: Step 2 is more of a cosmetic add-on than anything else. This is not necessary for this code hack to work.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.




[This message has been edited by AnthroRules (edited April 28, 2000).]
Quote Reply
Re: Rejected Link Notification In reply to
I made the mods you suggested to links.cfg and db.pl. I received the following error msg:
========================================
Error including libraries: syntax error at /home/davcon1/cgi-bin/links/admin/db.pl line 637, near "| |"
syntax error at /home/davcon1/cgi-bin/links/admin/db.pl line 638, near "} !~"

Make sure they exist, permissions are set properly, and paths are set correctly.
=========================================
db.pl has execute permissions. Also, after I make the patch and go to admin.cgi in my browser, I get a "save-as" download dialog box to save admin.cgi to my local hard drive.

If you would like, I can send my files to your email address.

-davidc
Quote Reply
Re: Rejected Link Notification In reply to
This forum makes spaces between the &#0124; &#0124;, so you either need to close the spaces between these characters -OR- replace the &#0124; &#0124; with or.

This should clear up the error messages.

And I do not have my email address listed in my profile for a reason....

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.


Quote Reply
Re: Rejected Link Notification In reply to
Removing the space between "| |" fixed db.pl but when I went to patch admin_html.pl I received the following error.
===================================
Error including libraries: syntax error at /home/davcon1/cgi-bin/links/admin/admin_html.pl line 1111, near "$font>"
syntax error at /home/davcon1/cgi-bin/links/admin/admin_html.pl line 1112, near "/textarea>|;
"
syntax error at /home/davcon1/cgi-bin/links/admin/admin_html.pl line 1119, near "<TR><TD VALIGN=TOP><$font><a href="$db_script_url?view_records=1&$db_cols[$db_url]=$tmp{$db_cols[$db_url]}" target="_blank">Duplicate Check</a"
syntax error at /home/davcon1/cgi-bin/links/admin/admin_html.pl line 1138, near "print qq|Email Reason"
syntax error at /home/davcon1/cgi-bin/links/admin/admin_html.pl line 1139, near "$db_email_reject</textarea>|;
}"

Make sure they exist, permissions are set properly, and paths are set correctly.
======================================

TIA -davidc
Quote Reply
Re: Rejected Link Notification In reply to
Okay...skip the Step 2 I provided with admin_html.pl file....Again...it is more cosmetic than functional...

Just add Step 1 and Step 2.

*sigh*

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
Anthro TECH, L.L.C
anthrotech.com
* Check Resource Center
* Search Forums
* Thinking out of the box (codes) is not only fun, but effective.