HI,
I use the phpmaker email module and it works very well.
I have activated email notification on add but I want the email to be sent when the send field (present in the table) is true. if the field is false you do not have to send the email
send email with condition
-
- User
- Posts: 100
send email with condition
-
- User
- Posts: 11767
You may simply use Email_Sending server event. Just check the condition in that event. If you want to send email, then make sure you return true, otherwise, return false.
-
- User
- Posts: 100
Perfect, thanks.... It happens that my company updates the mail server for a period and then during the insertion phase phpmaker returns the following popup error
"SMTP Connect() failed. https://github.com/PHPMailer/PHPMailer /wiki/Troubleshooting"
the record is inserted but the add page remains open until I cancel.
I can bypass this error, i.e. I would like the insertion to continue in the event of an error.... or after the error popup, when I click ok, the insertion process continues. Thank you
-
- User
- Posts: 9437
- You should turn on Debug and check the SMTP log and errors.
- Be reminded that you have submitted the page to the server side already for inserting and then sending email, you cannot have a client side button to pause and then continue. Note also that email is sent after records is inserted successfully. You should find out and rectify the SMTP error.