Gossamer Forum
Home : Products : Gossamer Links : Discussions :

[suggestion] Email sent on rating/review

Quote Reply
[suggestion] Email sent on rating/review
Suggestion

Why not have an option in admin/setip where you can turn on:
  • Email sent to webmaster (if exists in Users) when one of their links reveices a vote; and/or
  • Receives a review.


Dear (Username form USERS),

Your link:

(Copy of link from LINKS)

just received a (vote/review) of (1-10 in case of vote, display review in case of review).

Sincerely,

Links Manager
(insert Site_Title tag)



Comments? I think this would would increase your return customers.Wink


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [sooke] [suggestion] Email sent on rating/review In reply to
Hi Sooke

Sounds like a good idea and it would help in getting users to return to the site.

I'd like to suggest that GT setup a new forum called 'Sooke' Wink
The way your going the Forum will need it.

Keep it up as I think a lot of us are benefiting from the results.

Regards

minesite
Quote Reply
Re: [minesite] [suggestion] Email sent on rating/review In reply to
Quote:
I'd like to suggest that GT setup a new forum called 'Sooke' Wink
The way your going the Forum will need it.


Ha ha.... this got a good laugh in my household this morning! I have been accused of being addicted to "Gossiper Forum" .

I am glad my posts seem to be well received, and I am glad someone else likes this idea.

Maybe this could be thrown into the base version of GT Alex????

(I can only struggle with one plugin at a time - its keeps the amount of posting Sooke does down a littleWink)


http://www.iuni.com/...tware/web/index.html
Links Plugins
Quote Reply
Re: [sooke] [suggestion] Email sent on rating/review In reply to
hello

The options suggested by sooke is not difficult to build.

I use such things for mail to linkowners.
after database update, a routine will be called wich sends the mail to linkowner.

example:

sub rate_it {
# --------------------------------------------------------
# Give this link a rating.
#
my $id = $IN->param('ID');
my $rating = $IN->param('rate');

# Let's get the link information.
my $db = $DB->table('Links');
my $rec = $db->get ($id);
$rec or return { error => Links::language('RATE_INVALIDID', $id) };

# Make sure we have a valid rating.
unless (($rating =~ /^\d\d?$/) and ($rating >= 1) and ($rating <= 10)) {
return { error => Links::language ('RATE_INVALIDRATE', $rating), %$rec };
}

# Update the rating unless they have already voted.
my $click_db = $DB->table ('ClickTrack');
my $rows = $click_db->count ( { LinkID => $id, IP => $ENV{REMOTE_ADDR}, ClickType => 'Rate' } );
if ($rows) {
return { error => Links::language('RATE_VOTED', $id), %$rec };
}
else {
my $tmp = $rec->{Rating} * $rec->{Votes};
$rec->{Rating} = ($rec->{Rating} * $rec->{Votes}) + $rating;
$rec->{Votes} = $rec->{Votes} + 1;
$rec->{Rating} = $rec->{Rating} / $rec->{Votes};
$db->update ( { Votes => $rec->{Votes}, Rating => $rec->{Rating} }, { ID => $rec->{ID} });
$click_db->insert ( { LinkID => $id, IP => $ENV{REMOTE_ADDR}, ClickType => 'Rate', Created => \"NOW()" } );
}

# Mail the email.
if ($CFG->{admin_email_add}) {
my $to = "$input->{Contact_Email}";
my $from = "$input->{Email}";
my $subject = "Rating notice to : $input->{Contact_Name}\n";
my $cfg = Links::Config::load_vars();
my $msg = GT::Template->parse ( 'email-ratings.txt', { %$input, %$cfg }, { compress => 0, root => $CFG->{admin_root_path} . '/templates/admin' } );
require GT::Mail;
$GT::Mail::error ||= ''; # Silence -w
GT::Mail->send (
smtp => $CFG->{db_smtp_server},
sendmail => $CFG->{db_mail_path},
from => $from,
subject => $subject,
to => $to,
msg => $msg,
debug => $Links::DEBUG
) or die "Unable to send mail: $GT::Mail::error";
}

# Rating added successfully, return to rate_success page
return $rec;
}


It is not tested in this case but I think this could work without large troubles.
Quote Reply
Re: [ridesworld] [suggestion] Email sent on rating/review In reply to
Wow ridesworld! Looks great. This is designed to replace the current subs in the base GT version I take it. I wonder if this could be inlcuded in Links?

If not I guess you have paved the way for another plugin. Thanks!


http://www.iuni.com/...tware/web/index.html
Links Plugins