This topic is locked

Mass Mailer - Execute SQl Query after Email Sent

6/1/2017 5:10:23 AM
PHPRunner General questions
K
kelgate author

Anyone know whether it is possible to execute multiple queries after sending an email?
I've tried separating each statement with a semicolon (<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=24756&image=1&table=forumtopics' class='bbc_emoticon' alt=';)' /> but it flags a SQL error. (I have checked out the validity of the individual statements.)
Thanks in advance.
Kelvin

dermemo 6/10/2017

It is generally possible to have any amount of queries.
Usually, I have each query on its own, a little more work but along with commenting is a good practice to keep the events section readable in case you need changes.
What is the Error you are getting?

admin 6/12/2017

Show us your query and your error message.

K
kelgate author 6/15/2017



Show us your query and your error message.



Hi Folks.
Many thanks for following this up and please accept my apologies for the delay in getting back to you (I've been away).
Basically, I'm trying to update 2 tables and add a record to another whenever an email task is run. So I have three queries: first one to update the materials_order table to mark the order as sent (sent column set to 1), second to update the customer record status to "Order Sent", and a third to insert a customer_status_hist record. For the second and third queries, I have tried it without the now() timestamps, but it still failed.
This works...


This fails...


Error details...


Hopefully the above screenshots will provide some clues.
Many thanks in advance.
Kelvin

K
kelgate author 6/19/2017



It is generally possible to have any amount of queries.
Usually, I have each query on its own, a little more work but along with commenting is a good practice to keep the events section readable in case you need changes.
What is the Error you are getting?


Hi dermemo.
I've posted some details.
Thanks.
Kelvin

K
kelgate author 6/19/2017



Show us your query and your error message.


Hi Sergey.
I've posted some details.
Thanks.
Kelvin

admin 6/21/2017

We checked and it appears that at the moment MassMailer is only able to execute a single SQL Query after email is sent.
We'll add this functionality in a week or so.

K
kelgate author 6/30/2017



We checked and it appears that at the moment MassMailer is only able to execute a single SQL Query after email is sent.
We'll add this functionality in a week or so.


That would be excellent, Sergey.
I'm just getting to grips with the super added functionality in PHPR9.8 so a week or so for the MM upgrade would be great timing.
Cheers.
Kelvin

admin 7/3/2017

We updated MassMailer template to support multiple queries in 'Execute SQL query after email sent'. Use the same download link. Queries should be separated by semi-colon.