Я использую плагин this в приложении CakePHP. Кажется, что все работает, кроме отправки писем.CakePHP Paypal IPN Plugin email не работает
У меня есть следующий код в AppController.php
function afterPaypalNotification($txnId)
{
//Here is where you can implement code to apply the transaction to your app.
//for example, you could now mark an order as paid, a subscription, or give the user premium access.
//retrieve the transaction using the txnId passed and apply whatever logic your site needs.
$transaction = ClassRegistry::init('PaypalIpn.InstantPaymentNotification')->findById($txnId);
$this->log($transaction['InstantPaymentNotification']['id'], 'paypal');
//Tip: be sure to check the payment_status is complete because failure
// are also saved to your database for review.
if ($transaction['InstantPaymentNotification']['payment_status'] == 'Completed')
{
//Yay! We have monies!
ClassRegistry::init('PaypalIpn.InstantPaymentNotification')->email(array(
'id' => $txnId,
'subject' => 'Thanks!',
'message' => 'Thank you for the transaction!'
));
}
else
{
//Oh no, better look at this transaction to determine what to do; like email a decline letter.
ClassRegistry::init('PaypalIpn.InstantPaymentNotification')->email(array(
'id' => $txnId,
'subject' => 'Failed!',
'message' => 'Please review your transaction'
));
}
}
Но данные, возвращаемые из Paypal сохраняется в таблице instant_payment_notifications, но по какой-то причине письма не отправляются. Кто-нибудь пробовал этот плагин раньше, и работала ли электронная почта?
Нужно ли мне включить email.php в приложении/Config для работы электронной почты? Я где-то читал на веб-сайте Cake, что мне не нужен этот файл для работы с электронной почтой, поэтому я думаю, что это не проблема.
Любая помощь будет оценена по достоинству.
Спасибо.