Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
I'm using send_mail in sequence like this:
Code: Select all
<cms:if k_paypal_success >
    1. send_mail to the payer, with bcc to k_email_to
    2. create a new page with db_persist in admin panel with data about purchase
    3. send_mail to k_email_to with custom notification that purchase has been made
</cms:if>

I realize, that it might be unnecessary to send another mail, but it happens that step 3 does not get executed at all. I have put a debug to both send_mails and while on step 1 log file is created, on step 3 log file is not created (nothing is written in log created on step 1)

Is it a hosting issue, like number of emails per minute or something?

It bothers me, because if there are 2 simultaneous purchases there got to be 2 emails sent. But it might happen that only one would be sent. I'm intrigued!
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Even if there is limit imposed by the host, the cms:send_mail tag should log the message.

Looks like the script execution doesn't reach beyond the cms:db_persist line. Please concentrate at that point. Make sure the page is getting created, no redirects etc.
KK wrote: Even if there is limit imposed by the host, the cms:send_mail tag should log the message.

Looks like the script execution doesn't reach beyond the cms:db_persist line. Please concentrate at that point. Make sure the page is getting created, no redirects etc.

Thank you. Any ideas how to catch the probable cause?
Seems the same thing happens if I don't have db_persist.

EDIT: Found the probable cause. The scenario is the following: put 2 send_mails on a page.
<cms:send_mail from=k_email_from to=k_email_to
subject='Thank you'
debug='1' logfile='_logs/log-mail.html' html='0' >

this is the First message

</cms:send_mail>

And the same with 'Second message'.

Results:
On production server Http Error 500 is thrown and page is not served.
A log is created and contains only first mail. If I refresh the page, again first message get's sent (I receive it for real).

On localhost there is an php error:
Fatal error: Cannot redeclare PHPMailerAutoload() (previously declared in C:\Cloud\OpenServer\domains\mydomain.com\_admin\addons\phpmailer\PHPMailer\PHPMailerAutoload.php:24) in C:\Cloud\OpenServer\domains\mydomain.com\_admin\addons\phpmailer\PHPMailer\PHPMailerAutoload.php on line 31


Now it is closer to solution :) Please, take a look..

PS. On production in logs I have found the same fatal error:
PHP Fatal error: Cannot redeclare PHPMailerAutoload() (previously declared in /var/www/user58525/data/www/mydomain.com/_admin/addons/phpmailer/PHPMailer/PHPMailerAutoload.php:24) in /var/www/user58525/data/www/mydomain.com/_admin/addons/phpmailer/PHPMailer/PHPMailerAutoload.php on line 31
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
3 posts Page 1 of 1