- my @email_recipients = commit_notify_list($user, @changed_pages);
- return if !@email_recipients;
-
- # TODO: if a commit spans multiple pages, this will send
- # subscribers a diff that might contain pages they did not
- # sign up for. Should separate the diff per page and
- # reassemble into one mail with just the pages subscribed to.
- my $diff = join "\n", run_or_die('git-diff', "${sha1}^", $sha1);
-
- my $subject = "$config{wikiname} update of ";
- if (@changed_pages > 2) {
- $subject .= "$changed_pages[0] $changed_pages[1] etc";
- } else {
- $subject .= join " ", @changed_pages;
- }
- $subject .= " by $user";
-
- my $template = template("notifymail.tmpl");
- $template->param(
- wikiname => $config{wikiname},
- diff => $diff,
- user => $user,
- message => $message,
+ send_commit_mails(
+ sub {
+ $message;
+ },
+ sub {
+ join "\n", run_or_die('git-diff', "${sha1}^", $sha1);
+ }, $user, @changed_pages