FW.email
Sends an email
await FW.email (dest, subject, options = {cc:null, bcc:null, body:{text:""}, attachments:[]})dest: a string that is a comma separated list of email addresses (recipients)subject: a string that will be the subject of the mailopts: an optional object. Each option is optional.cc: string that is a comma separated list of email addresses (carbon copy)bcc: string that is a comma separated list of email addresses (blind carbon copy)body:text: if the body is plain text.\nis the character for a new linedocId: the id of a document in wilco (see /fleet/admin/docs). The document is either a static file or a template (seevariables)variables: a key value structure that will be passed to the doc (docId) to instanciate the template
attachments: an array of attachment. an attachment is an object with those valuesabsolutePath: the path of the file you want to attach. WARNING: it is the path in the server. So it is not directly readable from your client. The only usecase is the snapshot usecase (see below)docId: the id of a document in wilco (see /fleet/admin/docs). The document is either a static file or a template (seevariables)variables: a key value structure that will be passed to the doc (docId) to instanciate the template
Example of template doc
Note that the template email that is hosted by the docId is a groovy template. It means that the variables can be referenced like this:
Examples of calls:
simplest call:
await FW.email ("[email protected], [email protected]", "the subject")simplest call with body:
await FW.email ("[email protected], [email protected]", "the subject", {body: {text: "this is the body"} })a call with a template as body and a
cc:await FW.email ("[email protected], [email protected]", "the subject", {cc: "[email protected]", body: {docId: 83391, variables: {a: 1, b: {sub1: "my first option", sub2: my second option}}} })a call with a template as attachment:
await FW.email ("[email protected], [email protected]", "the subject", {body: "the body", attachments: [{docId: 83391, variables: {a: 1, b: {sub1: "my first option", sub2: my second option}}} }])
Snapshot as attachments! (beta)
Now, from an IFT, you can snapshot a WILCO page. It will create a PDF file containing the screenshot corresponding to the passed URL.
You can therefore add this file as an attachment to any email.
Last updated
Was this helpful?