Let's assume you want to give your customers an option to submit a form. Following submission form will be processed and a notification send to specified email address.
Above code creates a simple form with 2 text input fields and one file input field. This form is submitted via Ajax call to DataJet endpoint (please note task id is missing, replace it with your own task id).
Next, lets create a HTTP task with following code:
{% assign form_first_name =request.body.first |default: ""%}{% assign form_last_name =request.body.last |default: ""%}{% json upload_options %} {"fileName": "{{request.files.photo.name}}","multipart": {{request.files.photo |default: ""| json }},"public": true }{% endjson %}{% assign result = upload_options | file %}{% assign file_url =result.url %}{% capture email_html %} <div> <h2> Hello! </h2> <p> You have new form submission from {{form_first_name}} {{form_last_name}} </p> <p> Following photo was attached: </p> <imgsrc="{{file_url}}"width="500"height="600"> </div>{% endcapture %}{% capture email_params %} {"to": "test@email.com","subject": "New Form Submission","replyTo": "test@email.com","html": {{ email_html | json }} }{% endcapture %}{{ email_params | email }}{% json res %} {"body": {"status":"ok" } }{% endjson %}{% assign response = res %}