We just upgraded to 3.1.2 Pro from a much older version. In the old version we had this coded properly, in the newer version we're having issues. What we need: separate admin payment receipts for new payments than renewal payments. Meaning that if it's the first payment, it should send a different email than if it's a renewing payment. Different subject line, different text, and only for admins. What we've done so far - that isn't working quite right: 1. Added an entry to the config table for send_renew_payment_admin (compare to send_payment_admin) 2. Added an entry to the email template table for send_renew_payment_admin with the text we require. 3. Modified common.inc.php with the following in function mail_payment_admin: Code: /////////////////////////////////// $et = & new aMemberEmailTemplate(); $et->name = "send_payment_admin"; if (!empty($p['data'][0]['RENEWAL_ORIG'])) { $et->name = "send_renew_payment_admin"; } mail_template_admin($t, $et); We are now getting renewal receipts only - and only for renewals. New payments are not coming through as receipts in either format. Now - to take it one step farther, we created a test file called receipt_test.php that calls function mail_payment_admin with a memberid and paymentid. When we plug in the appropriate information for a new payment, we get the receipt. However if we do not manually run this file, we do not receive the email receipt. Logic would tell me that indicates that new payments are failing to call the mail_payment_admin function, or failing to call it correctly. Logic would also tell me that renewal payments are calling the function, and calling it correctly. However, a search of the code for the term mail_payment_admin results in only the function - I can't tell that it's being called anywhere. Any ideas? This would be a great feature to implement in future versions - but for right now I just need to start getting the right receipts for the right payments before my bookkeeper goes nuts! TIA
Hello, Looks correct to me I assume this is the line you added PHP: if (!empty($p['data'][0]['RENEWAL_ORIG'])) { $et->name = "send_renew_payment_admin"; } Are the new payments just being emailed as renewal payments? If so then you might try coding it differently to see if it makes a difference like the following: PHP: if (!($renewal=$p['data'][0]['RENEWAL_ORIG'])){ $et->name = "send_renew_payment_admin"; } Jimmy
No - we don't get the new receipts at all, only the renewals... unless I call the function manually after the fact. The function seems to work, I just can't figure out how and where it's called!