Add poll id and name to the notification subject line.

        Patch by yvi. 

diffs (39 lines):

diff -r 4cc0e262223e -r 69cf9ed01228 bin/upgrading/en.dat
--- a/bin/upgrading/en.dat      Sat Sep 12 11:16:59 2009 +0000
+++ b/bin/upgrading/en.dat      Sat Sep 12 11:32:39 2009 +0000
@@ -1756,6 +1756,10 @@ You can:
 .
 
 esn.poll_vote.subject=[[user]] voted in a poll!
+
+esn.poll_vote.subject2=Someone replied to poll #[[number]]: [[topic]].
+
+esn.poll_vote.subject2.notopic=Someone replied to poll #[[number]].
 
 esn.post_entry=[[openlink]]Post an entry[[closelink]]
 
diff -r 4cc0e262223e -r 69cf9ed01228 cgi-bin/LJ/Event/PollVote.pm
--- a/cgi-bin/LJ/Event/PollVote.pm      Sat Sep 12 11:16:59 2009 +0000
+++ b/cgi-bin/LJ/Event/PollVote.pm      Sat Sep 12 11:32:39 2009 +0000
@@ -92,7 +92,7 @@ my @_ml_strings = (
                                 #
                                 #You can:
                                 #
-    'esn.poll_vote.subject',    #[[user]] voted in a poll!
+    'esn.poll_vote.subject2',    #Someone replied to poll #[[number]]: 
[[topic]].
     'esn.view_poll_status',     #[[openlink]]View the poll's 
status[[closelink]]
     'esn.discuss_poll'          #[[openlink]]Discuss the poll[[closelink]]
 );
@@ -100,7 +100,11 @@ sub as_email_subject {
 sub as_email_subject {
     my $self = shift;
     my $u    = shift;
-    return LJ::Lang::get_text($u->prop('browselang'), 'esn.poll_vote.subject', 
undef, { user => $self->voter->display_username } );
+    if ( $self->poll->name ) {
+        return LJ::Lang::get_text($u->prop('browselang'), 
'esn.poll_vote.subject2', undef, { number => $self->poll->id, topic => 
$self->poll->name } );
+    } else {
+        return LJ::Lang::get_text($u->prop('browselang'), 
'esn.poll_vote.subject2.notopic', undef, { number => $self->poll->id } );
+    }
 }
 
 sub _as_email {
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to