wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[ljcom] r10913: LJSUP-9553. Incorrect notification for e...

Committer: gprochaev
LJSUP-9553. Incorrect notification for expired userhead

U   trunk/bin/upgrading/en_LJ.dat
U   trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm
Modified: trunk/bin/upgrading/en_LJ.dat
===================================================================
--- trunk/bin/upgrading/en_LJ.dat	2011-08-24 08:13:19 UTC (rev 10912)
+++ trunk/bin/upgrading/en_LJ.dat	2011-08-24 08:19:17 UTC (rev 10913)
@@ -4552,6 +4552,8 @@
 
 pay.product.rename_action.users2=<strong>[[old_username]]</strong> &rarr; <strong>[[new_username]]</strong><br />
 
+pay.product.userhead=UserHead
+
 pay.product.vgift=Virtual Gift
 
 pay.size.3xlarge=3X-Large
@@ -6849,6 +6851,32 @@
 sup_sponsored.status_change.U_to_U.subject|staleness=1
 sup_sponsored.status_change.U_to_U.subject=[[sitename]] Sponsorship Status Change
 
+subscription.expire.soon=Subscription Expiring Soon
+
+subscription.expire.warning=Subscription Expiring Warning
+
+subscription.expire.message_body<<
+Your [[acct_type]] account add-on of [[bonus_name]] for [[sitenameshort]] user
+[[user]] will expire in [[days]] days, at which time your paid account will revert to its standard features.
+
+You can renew your add-on of [[bonus_name]] in the [[sitenameshort]] Gift Shop here:
+
+[[uri]]
+
+[[acct_body]]
+
+If you have any questions or requests, please contact us by replying
+to this email.  We want to keep you happy.  :)
+
+Thanks,
+[[sitenameshort]] Team
+.
+
+subscription.expire.acct_body<<
+Avoid the hassle of renewing manually and set up automatic payments here:[[siteroot]]/manage/payments/
+
+.
+
 talk.copyright|staleness=1
 talk.copyright=The reproduction is prohibited in any form
 

Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm	2011-08-24 08:13:19 UTC (rev 10912)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm	2011-08-24 08:19:17 UTC (rev 10913)
@@ -200,7 +200,9 @@
             print "Mailing user $u->{user} about $days days of $item...\n";
 
             my $item_obj = LJ::Pay::Payment::PayItem->new_memonly(item => $item, subitem => $size);
+
             my $bonus_name = $item_obj->product_name("short");
+
             my $uri = _get_item_uri($item, $u->{journaltype} ne 'P');
 
             my $acct_body = '';
@@ -222,30 +224,53 @@
                 }
             }
 
+            my $body = "Your $acct_type account add-on of $bonus_name for $LJ::SITENAMESHORT user " .
+                       "\"$u->{user}\" will expire in $days days, at which time your paid account will revert to its standard features.\n\n".
+                       
+                       "You can renew your add-on of $bonus_name in the $LJ::SITENAMESHORT " .
+                       "Gift Shop here: \n\n" .
+
+                       "   $uri\n\n" .
+
+                       $acct_body .
+
+                       "If you have any questions or requests, please contact us by replying " .
+                       "to this email.  We want to keep you happy.  :)\n\n" .
+
+                       "Thanks,\n".
+                       "$LJ::SITENAMESHORT Team\n";
+
+            ## UserHead
+            my $lang = $u->prop('browselang');
+            if ($item =~ m#^uh-\d+#) {
+                $acct_type = LJ::Lang::get_text ($lang, 'ljcom.acct.paid');
+                if (!$u->get_cap('paid') && !$u->in_class('plus')) {
+                    $acct_type = LJ::Lang::get_text ($lang, 'ljcom.acct.free');
+                }
+                if (!$u->get_cap('paid') && $u->in_class('plus')) {
+                    $acct_type = LJ::Lang::get_text ($lang, 'ljcom.acct.plus');
+                }
+                $subject = LJ::Lang::get_text ($lang, $level eq "soon" ? "subscription.expire.soon" : "subscription.expire.warning");
+                $body = LJ::Lang::get_text ($lang,  'subscription.expire.message_body', undef, {
+                                user            => $u->{user},
+                                acct_type       => $acct_type,
+                                bonus_name      => $bonus_name,
+                                sitenameshort   => $LJ::SITENAMESHORT,
+                                days            => $days,
+                                uri             => $uri,
+                                acct_body       => $u->{journaltype} eq 'P' ? LJ::Lang::get_text ($lang, 'subscription.expire.acct_body', undef, 
+                                                            { siteroot => $LJ::SITEROOT } ) : "",
+                });
+            }
+
             LJ::send_mail({ 'to' => $u->email_raw,
                             'from' => $LJ::ACCOUNTS_EMAIL,
                             'fromname' => $LJ::SITENAMESHORT,
                             'wrap' => 1,
                             'charset' => 'utf-8',
                             'subject' => $subject,
-                            'body' => (
-
-                                       "Your $acct_type account add-on of $bonus_name for $LJ::SITENAMESHORT user " .
-                                       "\"$u->{user}\" will expire in $days days, at which time your paid account will revert to its standard features.\n\n".
-                                       
-                                       "You can renew your add-on of $bonus_name in the $LJ::SITENAMESHORT " .
-                                       "Gift Shop here: \n\n" .
-
-                                       "   $uri\n\n" .
-
-                                       $acct_body .
-
-                                       "If you have any questions or requests, please contact us by replying " .
-                                       "to this email.  We want to keep you happy.  :)\n\n" .
-
-                                       "Thanks,\n".
-                                       "$LJ::SITENAMESHORT Team\n"),
-                                   });
+                            'body' => ($body),
+                        });
         }
 }
 

Tags: dat, ljcom, pm, wisest-owl
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