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 mail

  • opts: 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. \n is the character for a new line

      • docId: the id of a document in wilco (see /fleet/admin/docs). The document is either a static file or a template (see variables)

      • 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 values

      • absolutePath: 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 (see variables)

      • 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:

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?