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.

01 - File Source: press the dropdown button to specify the source of your attachments. By default, PDF attachment and Imported PDF are selected. Support for other file sources is planned for a future release.

- PDF attachment refers to a PDF that was imported by means of the Import Email action.
- Imported PDF refers to a PDF that was imported by means of an Import from Folder action.

This makes it possible to export PDF email attachments differently from PDFs imported from a folder.

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 - Thumbnail: with this, you can adjust the size and appearance of the generated thumbnails for your attachments. Press the Thumbnail button to open the setup window.

1) Maximum size: here you can specify the maximum width and height of the attachment thumbnail.

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.

02 - Image: The insert image function is not yet implemented, please use html code to insert a hosted image or insert an image in base64 format. If you are not familiar with these concepts, feel free to contact us for support.

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: