120 |
chomp; |
chomp; |
121 |
next if (/^#/ || /^\s*$/); |
next if (/^#/ || /^\s*$/); |
122 |
my ($email, $name) = split(/\s+/,$_, 2); |
my ($email, $name) = split(/\s+/,$_, 2); |
123 |
$name ||= ''; |
$added++ if ($nos->add_member_to_list( email => $email, name => $name, list => $add_opt )); |
|
if (! Email::Valid->address($email)) { |
|
|
print "SKIPPING $name <$email>\n"; |
|
|
next; |
|
|
} |
|
|
print "# $name <$email>\n"; |
|
|
my $this_user = $users->find_or_create({ |
|
|
email => $email, |
|
|
full_name => $name, |
|
|
}) || die "can't find or create member\n"; |
|
|
my $user_on_list = $user_list->find_or_create({ |
|
|
user_id => $this_user->id, |
|
|
list_id => $list->id, |
|
|
}) || die "can't add user to list"; |
|
|
$added++; |
|
|
} |
|
|
|
|
|
foreach my $c_name ($loader->tables) { |
|
|
my $c = $loader->find_class($c_name)|| die "can't find $c_name"; |
|
|
$c->dbi_commit(); |
|
124 |
} |
} |
125 |
|
|
126 |
print "list ",$list->name," has $added users\n"; |
print "list ",$list->name," has $added users\n"; |