Index: branches/release-35/lib/MT/CMS/AddressBook.pm
===================================================================
--- branches/release-35/lib/MT/CMS/AddressBook.pm (revision 1810)
+++ branches/release-35/lib/MT/CMS/AddressBook.pm (revision 1940)
@@ -3,4 +3,182 @@
 use strict;
 use MT::Util qw( is_valid_email );
+use MT::I18N qw( wrap_text );
+
+sub entry_notify {
+    my $app   = shift;
+    my $user  = $app->user;
+    my $perms = $app->permissions;
+    return $app->error( $app->translate("No permissions.") )
+      unless $perms->can_send_notifications;
+
+    my $q        = $app->param;
+    my $entry_id = $q->param('entry_id')
+      or return $app->error( $app->translate("No entry ID provided") );
+    require MT::Entry;
+    require MT::Blog;
+    my $entry = MT::Entry->load($entry_id)
+      or return $app->error(
+        $app->translate( "No such entry '[_1]'", $entry_id ) );
+    my $blog  = MT::Blog->load( $entry->blog_id );
+    my $param = {};
+    $param->{entry_id} = $entry_id;
+    return $app->load_tmpl( "dialog/entry_notify.tmpl", $param );
+}
+
+sub send_notify {
+    my $app = shift;
+    $app->validate_magic() or return;
+    my $q        = $app->param;
+    my $entry_id = $q->param('entry_id')
+      or return $app->error( $app->translate("No entry ID provided") );
+    require MT::Entry;
+    require MT::Blog;
+    my $entry = MT::Entry->load($entry_id)
+      or return $app->error( 
+        $app->translate( "No such entry '[_1]'", $entry_id ) );
+    my $blog = MT::Blog->load( $entry->blog_id );
+
+    my $user = $app->user;
+    $app->blog($blog);
+    my $perms = $user->permissions($blog);
+    return $app->error( $app->translate("No permissions.") )
+      unless $perms->can_send_notifications;
+
+    my $author = $entry->author;
+    return $app->error(
+        $app->translate( "No email address for user '[_1]'", $author->name ) )
+      unless $author->email;
+
+    my $cols = 72;
+    my %params;
+    $params{blog} = $blog;
+    $params{entry} = $entry;
+    $params{author} = $author;
+
+    if ( $q->param('send_excerpt') ) {
+        $params{send_excerpt} = 1;
+    }
+    $params{message} = wrap_text( $q->param('message'), $cols, '', '' );
+    if ( $q->param('send_body') ) {
+        $params{send_body} = 1;
+    }
+
+    my $entry_editurl = $app->uri(
+        'mode' => 'view',
+        args   => { 
+            '_type' => 'entry',
+            blog_id => $entry->blog_id,
+            id      => $entry->id,
+        }
+    ); 
+    if ( $entry_editurl =~ m|^/| ) {
+        my ($blog_domain) = $blog->archive_url =~ m|(.+://[^/]+)|;
+        $entry_editurl = $blog_domain . $entry_editurl;
+    }
+    $params{entry_editurl} = $entry_editurl;
+
+    my $addrs;
+    if ( $q->param('send_notify_list') ) {
+        require MT::Notification;
+        my $iter = MT::Notification->load_iter( { blog_id => $blog->id } );
+        while ( my $note = $iter->() ) {
+            next unless is_valid_email( $note->email );
+            $addrs->{ $note->email } = 1;
+        }
+    }
+
+    if ( $q->param('send_notify_emails') ) {
+        my @addr = split /[\n\r,]+/, $q->param('send_notify_emails');
+        for my $a (@addr) {
+            next unless is_valid_email($a);
+            $addrs->{$a} = 1;
+        }
+    }
+
+    keys %$addrs
+      or return $app->error(
+        $app->translate(
+            "No valid recipients found for the entry notification.")
+      );
+
+    my $body = $app->build_email( 'notify-entry.tmpl', \%params );
+
+    my $subj =
+      $app->translate( "[_1] Update: [_2]", $blog->name, $entry->title );
+    if ( $app->current_language ne 'ja' ) {    # FIXME perhaps move to MT::I18N
+        $subj =~ s![\x80-\xFF]!!g;
+    }
+    my $address =
+      defined $author->nickname
+      ? $author->nickname . ' <' . $author->email . '>'
+      : $author->email;
+    my %head = (
+        id      => 'notify_entry',
+        To      => $address,
+        From    => $address,
+        Subject => $subj,
+    );
+    my $charset = $app->config('MailEncoding')
+      || $app->charset;
+    $head{'Content-Type'} = qq(text/plain; charset="$charset");
+    my $i = 1;
+    require MT::Mail;
+    MT::Mail->send( \%head, $body )
+      or return $app->error(
+        $app->translate(
+            "Error sending mail ([_1]); try another MailTransfer setting?",
+            MT::Mail->errstr
+        )
+      );
+    delete $head{To};
+
+    foreach my $email ( keys %{$addrs} ) {
+        next unless $email;
+        if ( $app->config('EmailNotificationBcc') ) {
+            push @{ $head{Bcc} }, $email;
+            if ( $i++ % 20 == 0 ) {
+                MT::Mail->send( \%head, $body )
+                  or return $app->error(
+                    $app->translate(
+"Error sending mail ([_1]); try another MailTransfer setting?",
+                        MT::Mail->errstr
+                    )
+                  );
+                @{ $head{Bcc} } = ();
+            }
+        }
+        else {
+            $head{To} = $email;
+            MT::Mail->send( \%head, $body )
+              or return $app->error(
+                $app->translate(
+"Error sending mail ([_1]); try another MailTransfer setting?",
+                    MT::Mail->errstr
+                )
+              );
+            delete $head{To};
+        }
+    }
+    if ( $head{Bcc} && @{ $head{Bcc} } ) {
+        MT::Mail->send( \%head, $body )
+          or return $app->error(
+            $app->translate(
+                "Error sending mail ([_1]); try another MailTransfer setting?",
+                MT::Mail->errstr
+            )
+          );
+    }
+    $app->redirect(
+        $app->uri(
+            'mode' => 'view',
+            args   => {
+                '_type'      => $entry->class,
+                blog_id      => $entry->blog_id,
+                id           => $entry->id,
+                saved_notify => 1
+            }
+        )
+    );
+}
 
 sub export {
@@ -37,6 +215,5 @@
 
     while ( my $note = $iter->() ) {
-        $app->print( $note->email );
-        $app->print(',');
+        $app->print( $note->email . "\n" );
     }
 }
Index: branches/release-35/lib/MT/CMS/Entry.pm
===================================================================
--- branches/release-35/lib/MT/CMS/Entry.pm (revision 1873)
+++ branches/release-35/lib/MT/CMS/Entry.pm (revision 1940)
@@ -1640,181 +1640,4 @@
     _finish_rebuild_ping( $app, $entry, scalar $q->param('is_new'),
         $has_errors );
-}
-
-sub entry_notify {
-    my $app   = shift;
-    my $user  = $app->user;
-    my $perms = $app->permissions;
-    return $app->error( $app->translate("No permissions.") )
-      unless $perms->can_send_notifications;
-
-    my $q        = $app->param;
-    my $entry_id = $q->param('entry_id')
-      or return $app->error( $app->translate("No entry ID provided") );
-    require MT::Entry;
-    require MT::Blog;
-    my $entry = MT::Entry->load($entry_id)
-      or return $app->error(
-        $app->translate( "No such entry '[_1]'", $entry_id ) );
-    my $blog  = MT::Blog->load( $entry->blog_id );
-    my $param = {};
-    $param->{entry_id} = $entry_id;
-    return $app->load_tmpl( "dialog/entry_notify.tmpl", $param );
-}
-
-sub send_notify {
-    my $app = shift;
-    $app->validate_magic() or return;
-    my $q        = $app->param;
-    my $entry_id = $q->param('entry_id')
-      or return $app->error( $app->translate("No entry ID provided") );
-    require MT::Entry;
-    require MT::Blog;
-    my $entry = MT::Entry->load($entry_id)
-      or return $app->error(
-        $app->translate( "No such entry '[_1]'", $entry_id ) );
-    my $blog = MT::Blog->load( $entry->blog_id );
-
-    my $user = $app->user;
-    $app->blog($blog);
-    my $perms = $user->permissions($blog);
-    return $app->error( $app->translate("No permissions.") )
-      unless $perms->can_send_notifications;
-
-    my $author = $entry->author;
-    return $app->error(
-        $app->translate( "No email address for user '[_1]'", $author->name ) )
-      unless $author->email;
-
-    my $cols = 72;
-    my %params;
-    $params{blog} = $blog;
-    $params{entry} = $entry;
-    $params{author} = $author;
-
-    if ( $q->param('send_excerpt') ) {
-        $params{send_excerpt} = 1;
-    }
-    $params{message} = wrap_text( $q->param('message'), $cols, '', '' );
-    if ( $q->param('send_body') ) {
-        $params{send_body} = 1;
-    }
-
-    my $entry_editurl = $app->uri(
-        'mode' => 'view',
-        args   => {
-            '_type' => 'entry',
-            blog_id => $entry->blog_id,
-            id      => $entry->id,
-        }
-    );
-    if ( $entry_editurl =~ m|^/| ) {
-        my ($blog_domain) = $blog->archive_url =~ m|(.+://[^/]+)|;
-        $entry_editurl = $blog_domain . $entry_editurl;
-    }
-    $params{entry_editurl} = $entry_editurl;
-
-    my $addrs;
-    if ( $q->param('send_notify_list') ) {
-        require MT::Notification;
-        my $iter = MT::Notification->load_iter( { blog_id => $blog->id } );
-        while ( my $note = $iter->() ) {
-            next unless is_valid_email( $note->email );
-            $addrs->{ $note->email } = 1;
-        }
-    }
-
-    if ( $q->param('send_notify_emails') ) {
-        my @addr = split /[\n\r,]+/, $q->param('send_notify_emails');
-        for my $a (@addr) {
-            next unless is_valid_email($a);
-            $addrs->{$a} = 1;
-        }
-    }
-
-    keys %$addrs
-      or return $app->error(
-        $app->translate(
-            "No valid recipients found for the entry notification.")
-      );
-
-    my $body = $app->build_email( 'notify-entry.tmpl', \%params );
-
-    my $subj =
-      $app->translate( "[_1] Update: [_2]", $blog->name, $entry->title );
-    if ( $app->current_language ne 'ja' ) {    # FIXME perhaps move to MT::I18N
-        $subj =~ s![\x80-\xFF]!!g;
-    }
-    my $address =
-      defined $author->nickname
-      ? $author->nickname . ' <' . $author->email . '>'
-      : $author->email;
-    my %head = (
-        id      => 'notify_entry',
-        To      => $address,
-        From    => $address,
-        Subject => $subj,
-    );
-    my $charset = $app->config('MailEncoding')
-      || $app->charset;
-    $head{'Content-Type'} = qq(text/plain; charset="$charset");
-    my $i = 1;
-    require MT::Mail;
-    MT::Mail->send( \%head, $body )
-      or return $app->error(
-        $app->translate(
-            "Error sending mail ([_1]); try another MailTransfer setting?",
-            MT::Mail->errstr
-        )
-      );
-    delete $head{To};
-
-    foreach my $email ( keys %{$addrs} ) {
-        next unless $email;
-        if ( $app->config('EmailNotificationBcc') ) {
-            push @{ $head{Bcc} }, $email;
-            if ( $i++ % 20 == 0 ) {
-                MT::Mail->send( \%head, $body )
-                  or return $app->error(
-                    $app->translate(
-"Error sending mail ([_1]); try another MailTransfer setting?",
-                        MT::Mail->errstr
-                    )
-                  );
-                @{ $head{Bcc} } = ();
-            }
-        }
-        else {
-            $head{To} = $email;
-            MT::Mail->send( \%head, $body )
-              or return $app->error(
-                $app->translate(
-"Error sending mail ([_1]); try another MailTransfer setting?",
-                    MT::Mail->errstr
-                )
-              );
-            delete $head{To};
-        }
-    }
-    if ( $head{Bcc} && @{ $head{Bcc} } ) {
-        MT::Mail->send( \%head, $body )
-          or return $app->error(
-            $app->translate(
-                "Error sending mail ([_1]); try another MailTransfer setting?",
-                MT::Mail->errstr
-            )
-          );
-    }
-    $app->redirect(
-        $app->uri(
-            'mode' => 'view',
-            args   => {
-                '_type'      => $entry->class,
-                blog_id      => $entry->blog_id,
-                id           => $entry->id,
-                saved_notify => 1
-            }
-        )
-    );
 }
 
