Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Validate of Newsletter-Subscribers

Quote Reply
Validate of Newsletter-Subscribers
If someone only wants to subscribe to the newsletter, he has not to validate its email-adress.

How can I change this?

Thx,
Chris
Thanks a lot for your help,
Christian

Quote Reply
Re: [cwschroeder] Validate of Newsletter-Subscribers In reply to
Hi,

did you find a solution for this?

A opt-in solution would be quite good!

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.
Quote Reply
Re: [ManuGermany] Validate of Newsletter-Subscribers In reply to
No, I only added some code in subscribe, so that a subscriber will be notified, that he is listed and how to unsubscribe, but that's not the best solution.

I also added some code to store IP adress and date for every signup and for every subscription.

Christian
Thanks a lot for your help,
Christian

Quote Reply
Re: [cwschroeder] Validate of Newsletter-Subscribers In reply to
Hi,

thanks for your reply.

Could you post/or pm your mods to me? This would be good!

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.
Quote Reply
Re: [ManuGermany] Validate of Newsletter-Subscribers In reply to
I added some fields to the datebase Zielgruppe, ip_new, ip_newsletter, then I changed my
cgi-bin/li/admin/Links/User /Subscribe.pm to:

sub subscribe {
# -----------------------------------------------------------
# Adds a user into a mailing list.
#
my $list = $IN->param('list');
my $email = $IN->param('email');
my $name = $IN->param('name');
my $Zielgruppe = $IN->param('Zielgruppe');

my $ip_add1 = $ENV{REMOTE_ADDR} || $ENV{REMOTE_HOST};
use GT::Date qw/:all/;
date_set_format('%yyyy%-%mm%-%dd% %HH%:%MM%:%ss%');
my $date_add = date_get();
my $ip_add2 = "$ip_add1 - $date_add";

if ($list) {
my $sth = $DB->table ('MailingListIndex')->select ( { Name => $list }, ['ID'] );
my ($id) = $sth->fetchrow_array;
$id or return { error => Links::language('SUBSCRIBE_INVALIDLIST', $list) };

if ($DB->table ('MailingList')->select( { Email => $email, ID => $id } )->rows) {
return { error => Links::language('SUBSCRIBE_ALREADYSUB') };
}
$DB->table('MailingList')->insert ( { Email => $email, ID => $id } );
return { action => 'subscribe' };
}
else {
my $res = 0;
if (! $USER) {
my $user_db = $DB->table ('Users');
my $sth = $user_db->select ( { Email => $email }, ['Username', 'Newsletter', 'Status', 'Zielgruppe'] );
my ($username, $newsletter, $status, $zielgruppe) = $sth->fetchrow_array;
if (! $username) {
my $pass = $user_db->random_pass;
$res = $user_db->insert ( Username => $email, Name => $name, Password => $pass, Status => 'Registered', Email => $email, Newsletter => 'Yes', Zielgruppe => $Zielgruppe, ip_newsletter => $ip_add2);
&send_user_conf($email, $name);
}
else {
if ($status eq 'blocked') {
return { error => Links::language('SUBSCRIBE_BLOCKED') };
}
if ($newsletter eq 'No') {
$res = $user_db->update ( { Newsletter => 'Yes', Zielgruppe => $Zielgruppe, ip_newsletter => $ip_add2 }, { Username => $username } );
&send_user_conf($email, $name);
}
}
}
else {
my $user_db = $DB->table ('Users');
my $sth = $user_db->select ( { Username => $USER->{Username} }, ['Status'] );
my $status = $sth->fetchrow_array;
if ($status eq 'blocked') {
return { error => Links::language('SUBSCRIBE_BLOCKED') };
}
else {
$res = $DB->table('Users')->update ( { Newsletter => 'Yes', Zielgruppe => $Zielgruppe, ip_newsletter => $ip_add2}, { Username => $USER->{Username}} );
}
}
return $res ? { action => 'subscribe' } : { error => Links::language('SUBSCRIBE_ALREADYSUB') };
}
}

sub send_user_conf {
# -----------------------------------------------------------
# Send confirmation by E-Mail

my $email = $IN->param('email');
my $name = $IN->param('name');
my $to = $email;
my $subject = "Ihre Registrierung";
my $from = $CFG->{db_admin_email};
my $cfg = Links::Config::load_vars();
my $msg = qq|Guten Tag $name,

Sie haben sich soeben im Newletter-Verteiler
eingetragen. Dieses Bestätigungsmail dient für Sie zur Kontrolle.
Eingetragene E-Mail-Adresse: $email

Sollten Sie sich nicht selbst eingetragen haben, können sich auch direkt vom Newsletter-Verteiler löschen,
indem Sie hier klicken:

|;

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";

}
Quote Reply
Re: [cwschroeder] Validate of Newsletter-Subscribers In reply to
Danke!



Eine gute Idee ist auch in die Newsletter-Bestätigungsmail Datum,Zeit und IP aufzunehmen!

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.
Quote Reply
Re: [cwschroeder] Validate of Newsletter-Subscribers In reply to
Hi,

which format do the fields ip_new, ip_newsletter have?

VarChar?

Regards,
Manu

Shopping Portal Shop-Netz.de® | Partnerprogramme | Flugreisen & Billigflüge | KESTERMEDIA e.K. | European Affiliate Marketing Forum.
Quote Reply
Re: [ManuGermany] Validate of Newsletter-Subscribers In reply to
Yes:

23 ip_add VARCHAR(50) No ip_add TEXT
24 ip_newsletter VARCHAR(50) No ip_newsletter TEXT
Quote Reply
Re: [cwschroeder] Validate of Newsletter-Subscribers In reply to
Hello!

Any hack or help to do the same (send an Email) when user unsubscribe from our newsletter?

Thanks!!!!
Quote Reply
Re: [avant] Validate of Newsletter-Subscribers In reply to
I made it hardcoded in the pm-file.

Only storing IP and date, if someone subscribes and signups, unsubscribe I didn't store, but that's nearly the same.

What do you need?
Thanks a lot for your help,
Christian

Quote Reply
Re: [cwschroeder] Validate of Newsletter-Subscribers In reply to
Hello,

I need exactly the same that you describe. I have in my .pm file the option to Email the user. I need the same (send an Email) when the user unsubscribe. Dont mind if its hard-coded.

Thanks!