afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] changelog2009-09-12 11:33 am

[dw-free] Change subject line for poll response emails

[commit: http://hg.dwscoalition.org/dw-free/rev/69cf9ed01228]

http://bugs.dwscoalition.org/show_bug.cgi?id=1699

Add poll id and name to the notification subject line.

Patch by [personal profile] yvi.

Files modified:
  • bin/upgrading/en.dat
  • cgi-bin/LJ/Event/PollVote.pm
--------------------------------------------------------------------------------
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 {
--------------------------------------------------------------------------------

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org