Gossamer Forum
Home : Products : Gossamer Links : Discussions :

New Users subscribe to Newsletter

Quote Reply
New Users subscribe to Newsletter
Finally I found the table where the newsletter subcribers are stored
It's in the table NewsletterSubscription and I can only view it by mysqladmin.

How can I change this table, so that every new user is subscribed to the newsletter automatically when he signs up?

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] New Users subscribe to Newsletter In reply to
nobody?

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] New Users subscribe to Newsletter In reply to
Hi,

Well, you should be able to achieve this by this global:

Code:
sub {
# create entry in NewsletterSubscription for new users
$DB->table('NewsletterSubscription')->add( { UserID => $IN->param('Username') , CategoryID => 0 } ) || die $GT::SQL::error;
}

Call it "setup_user_newsletter"

Then, in signup_success.html, add this to the very top of the page:

Code:
<%setup_user_newsletter%>

That should hopefully do what you want :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New Users subscribe to Newsletter In reply to
Hi Andy,
I thought the newsletter is by default set to "no" and I could change the default to "yes"

My users sign up in g-community, so I can not use links signup_success.html
Is it possible to change this global working with community?

thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] New Users subscribe to Newsletter In reply to
Hi,

Do you have "validation required" set in GComm?

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Matthias70] New Users subscribe to Newsletter In reply to
Hi,

You should be able to do it with this global:

Code:
sub {

my $NEWDB = new GT::SQL (
def_path => '/full/path/to/links/admin/defs',
cache => 0,
debug => 0,
subclass => 0
);

$NEWDB->table('NewsletterSubscription')->add( { UserID => $IN->param('comm_username') , CategoryID => 0 } ) || die $GT::SQL::error;

}

(change /full/path/to/links/admin/defs to the path of your GLinks /defs/ folder)

I need to know if you are using validation of accounts, before I can tell you which template to put it in though :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New Users subscribe to Newsletter In reply to
Andy wrote:

I need to know if you are using validation of accounts, before I can tell you which template to put it in though :)

Cheers

Hi Andy,
my users must validate their email

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] New Users subscribe to Newsletter In reply to
Hi,

OK, cool =)

I'm not 100% sure on you have your site setup, but I would imagine that putting the global call in this bit (in user_home.html):

Code:
<%if action eq 'verify'%>
<br />
<span class="title">
Your email address has been validated and you have successfully been logged in.</span>
<%elsif action eq 'signup'%>

..like:


Code:
<%if action eq 'verify'%>
<br />
<span class="title">
Your email address has been validated and you have successfully been logged in.</span>
<%global_name%>
<%elsif action eq 'signup'%>

Obviously the global_name global is the code I gave in my last post, but in GComm (the one with $NEWDB in it)

Hope that helps

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New Users subscribe to Newsletter In reply to
Hi Andy,
I put the <%newsletter>% in the include_login.html, cause that's the page, the user gets, when he clicks the validate link in the email.
But I get the following error from the global:

Code:
The system encountered a fatal error: Column CategoryID cannot be left blank at (eval 23) line 10.

GT::SQL::error => Column CategoryID cannot be left blank

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] New Users subscribe to Newsletter In reply to
Hi,

Mmm.. odd. Try:

Code:
sub {

my $NEWDB = new GT::SQL (
def_path => '/full/path/to/links/admin/defs',
cache => 0,
debug => 0,
subclass => 0
);

$NEWDB->table('NewsletterSubscription')->add( { UserID => $IN->param('comm_username') , CategoryID => "0" } ) || die $GT::SQL::error;

}

i.e in the add() statement, it has:

"0"

instead of just:

0

It may be treating the 0 as a "false" statement, although I don't think it should

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New Users subscribe to Newsletter In reply to
Still get an error Pirate
Code:
Column CategoryID cannot be left blank at (eval 23) line 10, line 32. GT::SQL::error => Column CategoryID cannot be left blank

Perhaps it's easier to let users decide on community signup, if the want an newsletter or not
just like in this thread
http://www.gossamer-threads.com//perl/gforum/gforum.cgi?post=297997#p297997

In this thread I did'nt get the newsletter to work, cause the table was wrong...

Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] New Users subscribe to Newsletter In reply to
Mmm.. which main category would you like them to sign up to ? I'm assuming "0" is "root", i.e all categories - but that may not be how it works. It may require a category ID (just change the "0" to whatever category ID you want to sign them up to with the newsletter)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] New Users subscribe to Newsletter In reply to
Andy wrote:
Mmm.. which main category would you like them to sign up to ? I'm assuming "0" is "root", i.e all categories - but that may not be how it works. It may require a category ID (just change the "0" to whatever category ID you want to sign them up to with the newsletter)

Cheers

But I want them to sign up to all categories Unsure
I looked in the newslettersubscribtion table. There is a field userID and a field categoriesID.
Both fields have a standard column. userID standard NULL and categoriesID standard 0

May be I can change the standard in this two columns?
But I don't know what standard stands for the sign up?

Matthias

Matthias
gpaed.de