Demos

Using the Document Designer to send customized emails.

8min
the document designer is one of the coolest procesio features to date it allows creating custom document templates and parametrizing them with process variables scenario let's say you work for the sales department of a company your company will have a huge sale on black friday and you'd like to send emails to a few potential customers to inform them about the sale you have a list of names, emails and procesio at your disposal so, how do you do it? we'll start by first building the template for the email and then the process that will send emails building the document template let's go to the document designer and create a new document template we've already set up some html to use as background so we'll add it from the code view we'll define two variables that will be used in our template name ➜ string string as a placeholder for the customer's name saledate ➜ string string as a placeholder for the date of the sale written in a custom format now, it's time to fill in the actual content of the email the document template is now ready to be used in our process building the process first we define some variables potentialcustomerlist ➜ list < potentialcustomer potentialcustomer > where potentialcustomer potentialcustomer is a dm with name ➜ string string representing the potential customer name email ➜ string string representing the potential customer email address blackfridaydate ➜ datetime datetime variable with 24 november 2023 as default value format ➜ string string variable with dddd, dd mmmm as default value formatteddate ➜ string string value containing blackfridaydate in format htmlbody ➜ string string containing the email body generated using the document template then we build the actual flow we format the black friday date using format datetime we go over each potential customer in our list using for each we generate an email body for each customer using generate document we send the generated html body in an email to each customer with send email time to run action pool for each format datetime generate document send email