[ljcom] r12971: LJSUP-13388: LJ Shop - Styles
Committer: wisest-owl
LJSUP-13388: LJ Shop - StylesU trunk/cgi-bin/LJ/Hooks/Customize.pm U trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm U trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm
Modified: trunk/cgi-bin/LJ/Hooks/Customize.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/Customize.pm 2012-11-29 14:10:11 UTC (rev 12970)
+++ trunk/cgi-bin/LJ/Hooks/Customize.pm 2012-11-30 09:23:20 UTC (rev 12971)
@@ -283,7 +283,7 @@
my $u = shift;
my $theme = shift;
- my $buy_url = $LJ::SITEROOT."/shop/theme/?uniq=".$theme->{uniq};
+ my $buy_url = $LJ::SITEROOT."/shop/theme/?theme_id=".$theme->{s2lid};
return "<strong><a href='$buy_url'>" . LJ::Lang::ml('ljcom.customize.buy_item.text') . "</a></strong>";
});
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm 2012-11-29 14:10:11 UTC (rev 12970)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem/Addon.pm 2012-11-30 09:23:20 UTC (rev 12971)
@@ -955,10 +955,10 @@
if $self->is_recbillable;
# send notification email to user
- my ($subj, $msg) = $self->_delivering_message($rcpt_u, $buyer_u);
+ my ($subj, $msg, $subj_self, $msg_self) = $self->_delivering_message($rcpt_u, $buyer_u);
warn "[$item_id]: _deliver_item is ok" if $::VERBOSE>1;
- return (1, $subj, $msg);
+ return (1, $subj, $msg, $subj_self, $msg_self);
}
sub _delivering_message {
Modified: trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm
===================================================================
--- trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm 2012-11-29 14:10:11 UTC (rev 12970)
+++ trunk/cgi-bin/LJ/Pay/Payment/PayItem.pm 2012-11-30 09:23:20 UTC (rev 12971)
@@ -654,8 +654,8 @@
}
# call virtual method
- my ($ok, $mail_subject, $mail_message);
- eval { ($ok, $mail_subject, $mail_message) = $self->_deliver_item($payment, $buyer_u, $rcpt_u, $note_rec_change); };
+ my ($ok, $mail_subject, $mail_message, $mail_subject_self, $mail_message_self);
+ eval { ($ok, $mail_subject, $mail_message, $mail_subject_self, $mail_message_self) = $self->_deliver_item($payment, $buyer_u, $rcpt_u, $note_rec_change); };
if ($@) {
my $rid = $self->get_rcptid;
my $bid = ($buyer_u) ? $buyer_u->{userid} : '(anonymous)';
@@ -688,7 +688,7 @@
# optional gift header
my $msg;
- if ($buyer_u && $buyer_u->userid != $self->get_rcptid) {
+ if ($buyer_u && $buyer_u->userid != $self->get_rcptid && $self->get_subitem !~ m#^theme-#) {
if ($self->get_anon) {
$msg = "(the following is an anonymous gift)\n\n"
} else {
@@ -706,6 +706,20 @@
'body' => $msg . $mail_message,
'force_schwartz' => 1,
});
+
+ if ($mail_subject_self && $mail_message_self && $buyer_u) {
+ my $buyer_email = $buyer_u->email_raw;
+ LJ::send_mail({
+ 'to' => $buyer_email,
+ 'from' => $LJ::ACCOUNTS_EMAIL,
+ 'fromname' => $LJ::SITENAMESHORT,
+ 'wrap' => 1,
+ 'charset' => 'utf-8',
+ 'subject' => $mail_subject_self,
+ 'body' => $mail_message_self,
+ 'force_schwartz' => 1,
+ }) if $buyer_email;
+ }
}
warn "[$item_id]: item delivered" if $::VERBOSE>1;
