Automatic Form Email Backup
The Internet runs on computers. Forms are processed and email is delivered with computers. Stuff happens to computers.
If you're using Master Form V4, here is a way to save a copy to a file of all email it sends. The idea is to have a backup file should the email sending fail.
In your form, you have a hidden field specifying the location of the email template file. For purposes of illustration, we'll assume the file name is emailout.txt and it is located in the "templates" subdirectory.
<input type="hidden" name="emailtemplate" value="templates/emailout.txt">
For purposes of email backup, that very same email template file can be used as a file template. Make a hidden field name="filetemplate" to tell Master Form V4 the file to use.
Make one more hidden field, name="dbfile", to tell Master Form V4 where to save the email backup file. For illustration, we'll assume the file is to be saved as mailbackup.txt in the "mailbackup" subdirectory.
Here is an example of the three hidden fields, email template, file template, and file location.
<input type="hidden" name="emailtemplate" value="templates/emailout.txt"> <input type="hidden" name="filetemplate" value="templates/emailout.txt"> <input type="hidden" name="dbfile" value="mailbackup/mailbackup.txt">
The above tells Master Form V4 to:
-
Compose an email using templates/emailout.txt and send it out.
-
Create a plain text data record using templates/emailout.txt
-
Append the plain text data record to file mailbackup/mailbackup.txt
The file mailbackup.txt is now updated with a copy of every email to be sent out.
Will Bontrager