We often have members that need the invoice to be emailed to someone else. Is it possible to define a "Billing Email" field and have the invoice automatically emailed to that address in the event it is not empty?
Hello, I am afraid there is not such feature by default. It is possible to implement custom solution to achieve it. You can add additional user field for billing email at aMember CP -> Configuration -> Add User Field Then use the following code in site.php file to add this address as CC to email with payment receipt http://www.amember.com/docs/Site.php_file PHP: Am_Di::getInstance()->hook->add(Am_Event::MAIL_TEMPLATE_BEFORE_PARSE, function(Am_Event $e) { $t = $e->getTemplate(); $c = $t->getConfig(); if ($c['name'] == 'send_payment_mail' && $t['user']->billing_email) { $e->getMail()->addCc($t['user']->billing_email); }}); You can billing email field to either signup or profile form in drag & drop forms editor at aMember CP -> Configurations -> Forms Editor Best Regards.
I don't have my payment receipts setup through Configuration >> Setup/Configuration >> E-Mail. Does this code only work for that? Is it possible to add a checkbox to the E-mail Messages to CC the billing email address?
Yes, it works only for 'E-Mail Payment Receipt to User' in current implementation. Do you use Payment Emails from? aMember CP -> Protect Content -> E-Mails In this case you just need to replace name of template in my code above from 'send_payment_mail' to 'payment'. Best Regards.
This is very useful. If I wish to send to a billing_email for Pending Invoices, can I just substitute the template name shown here with what I see in my Pending invoice template ? This is shown as misc.pending-notification.notify_pending . Is this valid to insert in the code above?
To clarify what I meant. Would the code look like this? Code: $t = $e->getTemplate(); $c = $t->getConfig(); if ($c['name'] == 'send_payment_mail' && $t['user']->billing_email) { $e->getMail()->addCc($t['user']->billing_email); } if ($c['name'] == 'misc.pending-notification.notify_pending' && $t['user']->billing_email) { $e->getMail()->addCc($t['user']->billing_email); }