[freeside-commits] branch FREESIDE_3_BRANCH updated. ae87637d716519b65ad0ed8ed2041651742255ac

Ivan ivan at 420.am
Wed May 15 02:39:36 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  ae87637d716519b65ad0ed8ed2041651742255ac (commit)
      from  a984addb22aa38e5d50bf693e88d3c8821bdfc4b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ae87637d716519b65ad0ed8ed2041651742255ac
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed May 15 02:39:31 2013 -0700

    queue all email receipts, RT#22731, RT#23023

diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm
index 0e9e8a7..38a11ed 100644
--- a/FS/FS/cust_pay.pm
+++ b/FS/FS/cust_pay.pm
@@ -10,7 +10,6 @@ use Date::Format;
 use Business::CreditCard;
 use Text::Template;
 use FS::UID qw( getotaker );
-use FS::Misc qw( send_email );
 use FS::Record qw( dbh qsearch qsearchs );
 use FS::CurrentUser;
 use FS::payby;
@@ -626,11 +625,18 @@ sub send_receipt {
   {
     my $msgnum = $conf->config('payment_receipt_msgnum', $cust_main->agentnum);
     if ( $msgnum ) {
-      my $msg_template = FS::msg_template->by_key($msgnum);
-      $error = $msg_template->send(
-        'cust_main'   => $cust_main,
-        'object'      => $self,
-        'from_config' => 'payment_receipt_from',
+
+      my $queue = new FS::queue {
+        'job'     => 'FS::Misc::process_send_email',
+        'paynum'  => $self->paynum,
+        'custnum' => $cust_main->custnum,
+      };
+      $error = $queue->insert(
+         FS::msg_template->by_key($msgnum)->prepare(
+          'cust_main'   => $cust_main,
+          'object'      => $self,
+          'from_config' => 'payment_receipt_from',
+        )
       );
 
     } elsif ( $conf->exists('payment_receipt_email') ) {
@@ -669,7 +675,12 @@ sub send_receipt {
         #setup date, other things?
       }
 
-      $error = send_email(
+      my $queue = new FS::queue {
+        'job'     => 'FS::Misc::process_send_generated_email',
+        'paynum'  => $self->paynum,
+        'custnum' => $cust_main->custnum,
+      };
+      $error = $queue->insert(
         'from'    => $conf->config('invoice_from', $cust_main->agentnum),
                                    #invoice_from??? well as good as any
         'to'      => \@invoicing_list,
@@ -686,8 +697,9 @@ sub send_receipt {
   } elsif ( ! $cust_main->invoice_noemail ) { #not manual
 
     my $queue = new FS::queue {
-       'paynum' => $self->paynum,
-       'job'    => 'FS::cust_bill::queueable_email',
+       'job'     => 'FS::cust_bill::queueable_email',
+       'paynum'  => $self->paynum,
+       'custnum' => $cust_main->custnum,
     };
 
     $error = $queue->insert(
@@ -699,7 +711,7 @@ sub send_receipt {
 
   }
   
-    warn "send_receipt: $error\n" if $error;
+  warn "send_receipt: $error\n" if $error;
 }
 
 =item cust_bill_pay

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cust_pay.pm |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)




More information about the freeside-commits mailing list