This topic is locked

runner_mail problem

10/4/2020 3:24:03 PM
PHPRunner General questions
K
kohle author

Hi,
I send an email with runner_mail function in the After record added event. (inline Add).
Sometimes it takes a while until the email is send and the fields stay editable until all is processed. (single and muliple inline add)

The user thinks that he didnt click on the save button and he click again."

Now the system shows an database error for duplicate index keys.
How can I show a message like "Email sending in process..." while phprunner is sending the email

and saving the record(s)

K
kohle author 10/5/2020



https://www.facebook.com/101291953274682/posts/how-to-display-a-popup-window-after-the-record-was-added-or-edited1-afteradd-eve/3791254114278429/
For inspiration ...


Thanks for this,

but what I want is a type of toast message. Before start of email send a info window and when done, closing the wndow automatically:
mess("Email sending in progress... ")

mail_runner

mess("")

Sergey Kornilov admin 10/6/2020

Since you do that in the event like AfterAdd you cannot communicate with the browser and display a message before and after the email was sent. It will be much easier if you were sending an email from the button's code where you have events like ClientBefore and ClientAfter.
What you can do in your case is to use BeforeSave event to display some sort of spinning 'Wait' image on the page that will disappear as soon as the page is reloaded:

https://xlinesoft.com/phprunner/docs/how_to_ask_for_confirmation_before_saving_record.htm