Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[ljcom] r11191: LJSUP-9894: Create text vars for hardcod...

Committer: amyshkin
LJSUP-9894: Create text vars for hardcoded notifications
U   trunk/cgi-bin/LJ/Hooks/ESN.pm
Modified: trunk/cgi-bin/LJ/Hooks/ESN.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/ESN.pm	2011-11-16 12:02:28 UTC (rev 11190)
+++ trunk/cgi-bin/LJ/Hooks/ESN.pm	2011-11-17 10:04:05 UTC (rev 11191)
@@ -46,31 +46,23 @@
         %{$opts->{_debug_headers}   || {}}
     );
 
-    if ( $u->{opt_htmlemail} eq 'N' ) {
-        LJ::send_mail({
-            to       => $ev->as_email_to($u),
-            from     => $ev->as_email_from(),
-            fromname => scalar($ev->as_email_from_name($u)),
-            wrap     => 1,
-            charset  => $u->mailencoding || 'utf-8',
-            subject  => $email_subject,
-            headers  => \%headers,
-            body     => $plain_body,
-        }) or die "unable to send notification email";
-    } else {
-        LJ::send_mail({
-            to       => $ev->as_email_to($u),
-            from     => $ev->as_email_from(),
-            fromname => scalar($ev->as_email_from_name($u)),
-            wrap     => 1,
-            charset  => $u->mailencoding || 'utf-8',
-            subject  => $email_subject,
-            headers  => \%headers,
-            body     => $plain_body,
-            html     => $html_body,
-        }) or die "unable to send notification email";
+    my $mail_param = {
+        to       => $ev->as_email_to($u),
+        from     => $ev->as_email_from(),
+        fromname => scalar($ev->as_email_from_name($u)),
+        wrap     => 1,
+        charset  => $u->mailencoding || 'utf-8',
+        subject  => $email_subject,
+        headers  => \%headers,
+        body     => $plain_body,
+    };
+
+    unless ( $u->{opt_htmlemail} eq 'N' ) {
+        $mail_param->{'html'} = $html_body;
     }
 
+    LJ::send_mail($mail_param) or die "unable to send notification email";
+
     return 1;
 });
 

Tags: amyshkin, ljcom, pm, zilogic
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments