Star2Billing / a2billing

A2Billing is a telecom switch and billing system capable of providing and billing a range of telecom products and services to customers such as calling card products, residential and wholesale VoIP termination, DID resale and callback services.
www.asterisk2billing.org
Other
180 stars 175 forks source link

Cron job a2billing_subscription_fee.php fails when template missing #72

Open imcdona opened 10 years ago

imcdona commented 10 years ago

If you're missing an email template, such as the "subscription_unpaid" template, the cron job a2billing_subscription_fee.php silently fails. Expected behavior is to have the cron job write the error to the log file for that cron job. In this case, an error should have been written to /var/log/a2billing/cront_a2b_subscription_fee.log

I caught the error by manually running the cron job and watching the output.

INSERT INVOICE : date, id_card, title, reference, description, status, paid_status => '2014-01-05 06:48:53' , '2', 'SUBSCRIPTION INVOICE REMINDER','201400000013','Your credit was not enough to pay yours subscription automatically. You have 3 days to pay this invoice (REF: 201400000013 ) or the account will be automatically disactived

',1,0 INSERT INVOICE ITEM : date, id_invoice, price, vat, description, id_ext, type_ext => '2014-01-05 06:48:53' , '171', '65','0','Subscription (Test Subscription)','7','SUBSCR' PHP Fatal error: Uncaught exception 'A2bMailException' with message 'Template Type 'subscription_unpaid' cannot be found into the database!' in /usr/local/src/a2billing/common/lib/Class.Mail.php:171 Stack trace:

0 /usr/local/src/a2billing/Cronjobs/a2billing_subscription_fee.php(301): Mail->__construct('subscription_un...', '2')

1 {main}

thrown in /usr/local/src/a2billing/common/lib/Class.Mail.php on line 171