This is a guide that will help you setup an external notifier if your Jotform email alerts failed to send or were in the bounce list.
Please note that this is for advanced users or who are familiar with programming.
Here are the requirements and steps needed to be followed:
- You need to have a server that runs PHP where you can execute the PHP script. Please consult your web hosting service for this.
- We will need to use PHPMailer to send the notifier using your email’s SMTP. Here’s the official Github page of PHPMailer: https://github.com/PHPMailer/PHPMailer. You’ll need to consult your email service provider to get your SMTP details. If you have a Gmail account, you can follow this guide and use that instead: Gmail’s SMTP Settings.
- Our script will use both the PHPMailer and Jotform’s API. What happens is that our script will check the mail log to your account and compare the submission ID of the form submitted to see if the email alerts were successfully sent. You can check Jotform’s PHP API library here: Jotform API PHP Library
- You can then copy the PHP script I made on this link: Email Status Checker PHP Script. This is what triggers the external email notifier to send.
- In the PHP script, you need to setup a few things, first, you need to use your API key here:
- After that, make sure to fill out the necessary SMTP details in the PHP script. You need to fill out the host, port, your username, password, recipient address, etc…
- You can then edit the text that will be displayed after the script is executed. Or you can also redirect the user to another link. The body of the email can be edited here:
- Now make sure to enable the “Send POST Data” in your Preferences setting.
Click “Form Settings” tab and click “Show More Options”.
Here you need to enable the “Send Post Data” option to “Yes”.
- Now placed the link of your PHP script to your “Thank You” settings:
Paste the path of your PHP script here.
- Here’s an example of how this works:
A user submits your form.
The user will then be redirected to the PHP script and it will execute it. The script will check if there are failed email alerts on that specific submission. In my case, I’m printing the details of the email alert that failed. You can, of course, change this message or redirect the user to another link. Below you can see that my autoresponder failed because the email address I entered is email@example.com which is not valid.
If there was indeed an email alert that failed, then it will notify the recipient email address you setup in the SMTP in our PHP script. In my case, this is how it looks like:
You can edit the body of the email.
You now have a script that notifies you if any of your email alerts fails. In case you find failed email alerts, you can check this section on how to troubleshoot email problems: Guides: Email Problems
If you have any questions, feel free to leave a comment below or you can open a new thread in our forum.