Igor Gariev (gariev) wrote in changelog,
Igor Gariev
gariev
changelog

[ljcom] r10590: LJSUP-8875: No notifications in Inbox an...

Committer: gariev
LJSUP-8875: No notifications in Inbox and LJ Alert: removing notification from LJ Shop

U   trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm	2011-06-01 05:49:59 UTC (rev 10589)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm	2011-06-01 09:16:47 UTC (rev 10590)
@@ -628,31 +628,34 @@
         }
     }
 
-    unless ($mail_message && $mail_subject) {
-        warn "[$item_id]: item delivered, but no text for mail notification is given" if $::VERBOSE>1;
-        return;
-    }
+    ## send notification e-mail to receiver of the payitem
+    unless ($payment->payvar_get('do_not_notify_recepient')) {
+        unless ($mail_message && $mail_subject) {
+            warn "[$item_id]: item delivered, but no text for mail notification is given" if $::VERBOSE>1;
+            return;
+        }
 
-    # optional gift header
-    my $msg;
-    if ($buyer_u && $buyer_u->userid != $self->get_rcptid) {
-        if ($self->get_anon) {
-            $msg = "(the following is an anonymous gift)\n\n"
-        } else {
-            $msg = qq|(the following is a gift from $LJ::SITENAMESHORT user "| . $buyer_u->username . qq|")\n\n|;
+        # optional gift header
+        my $msg;
+        if ($buyer_u && $buyer_u->userid != $self->get_rcptid) {
+            if ($self->get_anon) {
+                $msg = "(the following is an anonymous gift)\n\n"
+            } else {
+                $msg = qq|(the following is a gift from $LJ::SITENAMESHORT user "| . $buyer_u->username . qq|")\n\n|;
+            }
         }
+
+        LJ::send_mail({
+            'to'        => $email,
+            'from'      => $LJ::ACCOUNTS_EMAIL,
+            'fromname'  => $LJ::SITENAMESHORT,
+            'wrap'      => 1,
+            'charset'   => 'utf-8',
+            'subject'   => $mail_subject,
+            'body'      => $msg . $mail_message,
+        });
     }
-
-    LJ::send_mail({
-        'to' => $email,
-        'from' => $LJ::ACCOUNTS_EMAIL,
-        'fromname' => $LJ::SITENAMESHORT,
-        'wrap' => 1,
-        'charset' => 'utf-8',
-        'subject' => $mail_subject,
-        'body' => $msg . $mail_message,
-    });
-    
+        
     warn "[$item_id]: item delivered" if $::VERBOSE>1;
     
     return 1;

Tags: gariev, ljcom, pm
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