MetaServer > Help > Export to Email

030-010 MetaServer Export – Export to Email

MetaServer’s Export to Email feature allows you to distribute your processed documents electronically through email. Fields can be used to specify the email recipient(s), subject, attachment’s file name and to define the body text.

Some example use-cases:

– Email the processed documents to trigger a business process.
– Email documents to a predefined email address to save it in a document management system.
– Automatically send the processed documents as PDF attachments to specified recipients.
– Email documents with missing information, for example, a missing signature, to a pre-defined email address for exception processing.

In our example, we will make use of the “CB – INVOICES US” workflow. This workflow is automatically installed with CaptureBites MetaServer.

 
We want to make it possible to mark invoices during validation for being emailed to management. For example, if an invoice is higher than $20,000, we want to email it to management:

The email will have a dynamic body text where the document’s extracted fields are filled out. The recipient’s address is specified in a field.

01 Export to Email – Adding the Action

To add an Export to Email action, select the action after which you want to insert the Export to Email action and press Add -> Export -> to Email. The Setup window will automatically open.

You can also open an existing Export to Email action by double-clicking the action or by pressing the setup button on the right side of the action or in the ribbon, as shown below.

02 Export to Email – Setup – Send information

When opening the Export to Email setup window, the Send Information tab is opened by default. Here, you specify your SMTP server and Email header settings.

TIP: The thumbnail on the right will follow you, so you can easily refer to the Setup window. Click on the thumbnail to make the image larger.

Don’t forget to add a description to your action.

01 – SMTP Server: replace the placeholder CaptureBites SMTP Server settings with your own SMTP Server details. The CaptureBites SMTP server is only meant for demo and test purposes, please use your own server settings when the workflow is used in production.

Your SMTP Server settings can be found by contacting your IT department or through your e-mail provider. SMTP settings for Gmail can be found as step 2 here. For Office 365, you can find the SMTP settings here.

1) Address: enter your email provider’s SMTP server address.

2) User name: the user name is typically your email address. When in doubt, contact your IT department.

3) Password: enter your SMTP server password. This is often the password you use to log into your email system. When in doubt, contact your IT department.

4) Timeout: if you have a slow or erratic internet connection, consider increasing the Timeout setting.

5) Check internet connection: if you only send internal email, which doesn’t require an internet connection, you can disable this option.

6) SSL: SSL (secure socket layer) is a way of encrypting your email data as it travels across the internet. Check with your email provider if they require SSL and enable this option if they do. Gmail, for example, requires SSL.

7) Port: the SMTP Port is often 25 or 587 if you don’t use SSL. Port 465 is typically used in combination with implicit SSL.

TIP: If you want to use Gmail as your SMTP server, first login to Gmail on the station running MetaServer via a browser. In that way, the IP address of that station becomes white listed on the Google SMTP servers and you can send e-mails from MetaServer. Gmail’s security strategy changes frequently and Gmail also sets limits to the number of emails you can send through smtp.gmail.com. So, we advise to only use smtp.gmail.com for tests or if the number of emails sent by MetaServer is limited.

02 – Email header: here, you enter the email header information.

1) From: enter the sender’s email address.

2) Display name: this is the sender’s “friendly” name. For example, you could send emails as noreply@company.com and use “Please do not reply” as the friendly name. The email address will then be converted into the “friendly” display name at the receiver’s end.

3) To: you can enter the recipient’s email address manually or select a field holding it. You can enter multiple email addresses, or the selected field can hold multiple email addresses.

You can optionally specify the display name by separating it with a comma “,”.
For example: jps@customer.com, James P. Sullivan.

You can also specify multiple recipients by separating them with semi-colons “;” or colons “:”. For example: john@customer.com,John Doe;jane@customer.com,Jane Doe.

Some more examples of valid email addresses:
– jps@customer.com
– randallboggs@customer.com:mike.wazowski@customer.com,Mike Wazowksi;jps@customer.com,James P. Sullivan

If you want to use an index field, holding multiple email addresses. Use the same syntax when you set the field value using a Set Field Value rule in your Extract action:

4) Cc: with cc recipients you can, for example, import incoming orders and email them to your customers as a confirmation. You can also cc a person in sales administration to fulfill the order. Another example is an “Archive” email address, to archive all outgoing email for later reference.

Press the Edit button next to the Cc box to open its setup window and specify one or more cc email addresses.

5) Subject: you can compose your email subject by combining fixed values, fields and metadata. Click on the drop-down arrow to pick from a list of possible values. You can see an example of your Subject line below the input field.

03 – Test: enter your email address in the “To” input field as the recipient and press the “Test” button to check your connection. You will receive an email confirming that the connection is successful. Don’t forget to change it back to the correct recipient after testing.

03 Export to Email – Setup – Attachments

Use the attachments tab to specify your email’s attachments’ settings.

Don't forget to add a description to your action.

01 - File Source: press the dropdown button to specify the source of your files.

By default, Processed PDF is selected. This means that the output will be a PDF, no matter what the original imported file type was.

- PDF/TIF/JPG/PNG attachment: refers to PDF, TIF, JPG or PNG files that were imported by means of the Import Email action.

- Email PDF: refers to the email body converted to PDF format.

- Email EML: refers to the complete imported Email including all its attachments in EML format.

- Email MSG: refers to the complete imported Email including all its attachments in MSG format.

- Imported PDF/TIF/JPG/PNG: refers to the original PDF, TIF, JPG or PNG files that were imported by means of an Import from Folder action.

- Processed PDF: refers to the PDF or TIF after every prior action. For example, if you've applied a Scale Page(s) action before exporting to a folder, it will export the scaled PDF.

- Processed TIF: refers to the TIF version of an imported PDF or PDF attachment converted to TIF with a Convert to Multipage TIF action.

NOTE: if you want to separate an imported multipage TIF file and export the separated TIF files, you need to add a Convert to Multipage TIF action before exporting. In the export action, select "Processed TIF" as the File Source.

1) Labels: you can change the labels of each file source if you want to use them later as metadata values in your settings.

02 – Attach files: enable this option if you want to attach files to your email.

1) File name: compose your attachment file name by combining fixed values, fields and metadata. Click on the drop-down arrow to pick from a list of possible values. You can see an example of your file name below the input field.

03 – Attach index file: enable this option if you want to attach an index file to your email.

1) File name: compose your attachment index file name by combining fixed values, fields and metadata. Click on the drop-down arrow to pick from a list of possible values. You can see an example of your index file name below the input field.

01 Index file – Setup

 
To set up the format and content of your index file attachment, press the “…” button next to the File name’s input box.

The index file setup window opens. Below is an example of a CSV index file. In this case, it holds every extracted field value.

02 – Encoding: specify the required encoding method.

03 – Header, Content & Footer: you can freely define the header, body and footer of your index file by combining fixed words, fields and metadata.

In this example, we export a CSV index file. If we open it in a CSV Viewer, it looks like this:

04 – Preview: to see a preview of your index file, press the Preview button. The preview window opens and shows an example output of your index file. In the example below, you see the preview of our CSV file.

In this example, we export a CSV index file. If we open it in a CSV Viewer, it looks like this:

04 Export to Email – Setup – Text Message

The Text Message tab allows you to set up and format your email’s body text. This is all plain text, this is useful if your recipient’s e-mail application does not support HTML text.

You can freely define the header, body and footer of your body by combining fixed values, fields and metadata using the dropdown arrows.

05 Export to Email – Setup – HTML Message

The last tab opens the HTML Message Setup screen. You can define your message in HTML format here.

With HTML you can use various font styles and insert hyperlinks and images in your body text.

Typically, you create the HTML code with an HTML editor, like HTML-Online or offline tools like Brackets or KompoZer. These kinds of editors allow you to format the text with standard word processing tools. The tool will then generate the HTML code for you, which you can copy and paste into the Header, Content and / or Footer input boxes.

For example, using the HTML-Online tool:

Use the text editor on the left to set up your body. On the right, your HTML code will be generated on the fly.

Press the Preview button to see the result in a Preview window.

When you’re satisfied with the result, copy the HTML code…

…and paste it in the Content input box.

01 Image – Setup

You can insert one or more images in your email body. These can be thumbnails from the document or up to 5 images from disk.

You can insert the images to your email by adding Document thumbnail or From disk variables to your header, content or footer:

01 – Document thumbnail: you can insert 1 or more pages of the document in your HTML header, content or footer.

1) Maximum size: define the maximum width and height of the bounding box your document thumbnails will be fitted in. We recommend using the same value for both width and height. In that way, portrait and landscape pages will both be displayed with the same dimensions.

2) Border: if you want a border around your thumbnails, you can specify the thickness and the color. If you don’t want a border, set the thickness to 0 pixels.

3) Variables: to insert a document thumbnail in your email body, you can choose between the following variables:

  • Full HTML: this option generates the full HTML code to insert the thumbnail of page 1 in the email body. The thumbnail will be displayed in a 1:1 ratio using the exact width and height of the thumbnail. The thumbnail’s dimensions are defined in the Image setup.

If you prefer to create your own custom HTML code, you can use the following variables:

  • { Document Thumbnail, 1 }: this field holds the document’s image pf page 1. In your HTML code, use this as the image source.
  • { Document Thumbnail Width, 1 }: this field holds the width of page 1 fitting to a bounding rectangle of 600 x 600 pixels. You can change the bounding rectangle in the Image Setup. In your HTML code, use this as the width to fit your thumbnail to the exact width of the thumbnail image.
  • { Document Thumbnail Height, 1 }: this field holds the height of page 1 fitting to a bounding rectangle of 600 x 600 pixels. You can change the bounding rectangle in the Image Setup. In your HTML code, use this as the height to fit your thumbnail to the exact height of the thumbnail image.

Once selected, set the page number parameter (default: 1) to the desired page number. Use a negative number to start counting from the end.

For example:
– Enter 1 for the 1st page
– Enter -1 for the last page
– Enter -2 for the page before the last page
– Etc.

02 – From disk: you can insert 1 to 5 images from disk in your HTML header, content or footer.

To make your own images available to MetaServer, you need to image files (JPG, PNG, static and animated GIF) to the following folder:
C:\ProgramData\CaptureBites\Programs\MetaServer\Data\Images

Next, map them with Image 1 through 5 in the Image from Disk setup.

1) Variables: to insert an image from disk in your email body, you can use the following variables:
 

  • Full HTML: this option generates the full HTML code to insert image 1 in the email body. By default, the image will not be scaled and will display in a 1:1 ratio using the exact width and height of the image. Tweak the HTML code to scale the image.
  • Full HTML including hyperlink: this option generates the full HTML code to insert image 1 in the email body, opening a hyperlink in the default browser. You can use this, for example, to insert your company logo in the email footer pointing to your company’s website.
    By default, the image will display in a 1:1 ratio using the exact width and height of the image. Change the number to 2, 3, 4 or 5 to insert another image. Images 1 through 5 can be mapped in the Image from Disk setup.
    f you prefer to use your own custom HTML code, you can adjust the values using the following variables:
  • { Image From Disk, 1 }: this field holds the image value. In your HTML code, use this as the image source.
  • { Image From Disk Width, 1 }: this field holds the width value of your image. In your HTML code, use this as the width to display your image to its original size.
  • { Image From Disk Height, 1 }:  this field holds the height value of your image value. In your HTML code, use this as the height to display your image to its original size.

03 – Preview: planned for future release.

TIP: you can copy the current settings and paste them in another setup window of the same type. Do this by pressing the Settings button in the bottom left of the Setup window and by selecting Copy. Then open another setup window of the same type and select Paste.

06 Export to Email – Result Example

 
During Validation, a document was tagged for management review. As a result, the following mail with the document attached was sent to the manager’s email which we specified as the recipient: