Creating and managing effective business depends on how you manage different tasks. And the more automated are tasks, the more it will be easier for you to focus on the real work.
Today using WayScript, we’ll create a script to automatically generate receipt when a form is submitted.
We want to generate the receipt when a form is submitted. WayScript has Form Trigger integration you can use to create forms with different fields, make it public, and receive submitted information as JSON.
Add it as a Trigger.
The next step now is to configure the fields we’ll use. To keep things simple for this tutorial, I decided to use just three inputs: The technology your client wants (Ah yes! Here, we are acting as a web development agency :D ), the existence of a logo, and his email address.
Well, here we go.
We have the fields of our form configured, now turn on the trigger and visit the page.
Why using Python here?
Add the Python module.
Now, click on edit the code, and replace the existing Python Code with this.
So basically, we are retrieving the value of keys in the variables dictionary and performing comparisons to calculate the fees.
Then we register a variable fee in the variables dictionary of WayScript, so we can access it in other modules.
We’ll use SendEmail to first, send to us the receipt.
Add Send Email module.
Once you’ve added the module, let’s enter the Email Subject and the body of the email.
Great. Now, be sure the trigger is activated and make a test. And check the logs.