Email attachments

Email attachments

This section covers the attachment related options for outgoing emails from InterFormNG2.

1. Create email with one simple PDF as attachment
If you want to create a simple outgoing email with a single PDF attachment, that is the result of the merge between the input file (XML or spooled file), then you should consider the workflow component, Create PDF email.
2. Create email without any attachments
If you want to create an email without any attachments, then you should consider the workflow component, Send an HTML email.

Another way could be to simply use an input text - or HTML file and use that directly as the email contents.

Here is a workflow, which waits for a text file in a folder. When a text file is found an email is generated where the contents of the email is simply the contents of the incoming text file:


First the email details are setup:

- and then the email is sent via to email server:



You can setup a workflow in a similar way to handle an input HTML file in the same manner
3. Create email with an extra attachment
If you want to generate an outgoing email with an extra attachment which e.g. contains some general Terms & conditions, then you can do that like below:


This workflow consists of two components:
This component loads a PDF file, that has been uploaded to the other library folder as a resource. This file is called, TC.pdf and is inserted into the email as an attachment named Terms & Conditions.pdf.

The second component creates a normal email:





4. Add an attachment, that is not the usual PDF file
This section can be considered, if you want to add an attachment in the outgoing email, that is not the usual PDF file. This can help you, if you want to e.g. add a file, that has been digitally signed, an Excel file or any other attachment.

In this example we want to merge an input XML file with a template into a PDF file, that PDF is then to be digitally signed and then sent as the single attachment in an outgoing email.

This is done with this workflow:

Each component are listed below:
1. The first component is Payload to named property
This component saves the initial input file (which probably is an XML file) and stores it under the name, backupData. We will restore that into the payload later.


2. The second component creates a PDF document in the payload. This overwrites the initial payload.

3. Now we digitally sign the PDF file in the payload:

4. Now we set the name of the attachment, that we want to add:

5. Now we copy the payload to the attachment (with the name set above):

6. Next we restore the named property back into the payload:

7. The final step is to generate and send the email (with the attachment):

(The component, Send an HTML email does not add any additional attachments).

Add multiple attachments from a folder

If you want to collect e.g. PDF files with invoices from a folder, that are waiting to be sent to a customer as multiple attachments in a single email, then you should consider example 1, which is shown for the workflow component, List filesystem. There is also a suggestion for an add on in example 2Direct file access is a prerequisite for this solution.


Add multiple attachments from a resource folder

If file access is not an option and you still want to collect multiple PDF files found in a folder and add them as multiple attachments in a single email, then you can consider to save the files as resources e.g. in the other folder of the Library. Then you should consider the workflow component, List resources and build a workflow similar to what is shown in example 2.


 
    • Related Articles

    • Read from email server

      The workflow input type, Read from email server can be used, if you want InterFormNG2 to read incoming emails from a mail server and then process these emails. You can select this input type, when you create a new workflow: The parameters of this ...
    • Email output

      This section contains information about emailing from (and to) InterFormNG2. For the most email scenarios you would need to setup an email server and then use either of the workflow components, Create PDF email (if you want a standard PDF attachment) ...
    • PDF extract attachments

      The advanced, utilities workflow component, PDF extract attachments can be run for a payload, that contains a PDF file. The component extracts all attachments from the PDF file and creates attachments in the workflow with the same name as what the ...
    • Email details

      This advanced set meta data workflow component, Email details sets various email details of the next email, that is sent. Email details has these parameters: Email to The receiver(s) of the email. Multiple receivers should be separated with a semi ...
    • Email servers

      In order to send out emails from InterFormNG2 you first need to set up an email server in the InterFormNG2. You can setup email servers both for the entire InterFormNG2 system and for a tenant. The Email server for the InterFormNG2 system is used for ...