Gossamer Forum
Home : Gossamer Threads Inc. : Discussion :

Plugin Newsletter

Quote Reply
Plugin Newsletter
Hello,

I seek a solution to give to the user his number of NewsLetter recorded.

If <%NewsLetter_total_Username(ID) = 0 %>

Message 1

If <%NewsLetter_total_Username(ID) = ou > 1 %>

Message 2

<%endif%>

On the login_success.html page
It is to hold the attention on the service (NewsLetter).

Thank you for your assistance.

Mick
Quote Reply
Re: [mick31] Plugin Newsletter In reply to
You can just make a new global called newsletter_count

Code:
sub {
my $db = $DB->table('Newsletter_Category');
my $sth = $db->select({ UserID => $USER->{Email} }, [ 'Count(distinct(CategoryID))'] );
return $sth->fetchrow_array();
}


Then on the login_success.html template, add the following:

<%if newsletter_count == 0%>
You can subscribe to our Newsletter.
<%elsif newsletter_count > 0%>
You have <%newsletter_count%> NewsLetter.
<%endif%>


Virginia