How-to generate a PDF and send it by e-mail



Introduction

In certain processes it is necessary to compile information in a PDF and deliver it to a group of users. This article describes by means of an example how this can be done in the CoreOne Workflow Engine.

Create PDF

1

First of all you need to load the required context values that you want to replace in your template. For example, select the activity 'CoreIdentity / GetContextParametersActivity', which loads all attributes of a core identity.

2

Next, add the 'GeneratePdf' activity

3

In the settings of the activity you can pass the context values loaded in the previous activity as replacements and specify the template name. Save the result in a new object of the type 'MemoryStream

Send email with attachment

1

Add the 'Send-Mail' activity

2

In the settings of the activity they can set the text, the sender and other settings.

Important:

You add the previously generated memory stream here as an attachment. You can do this most simply with the following configuration:

{ new iTsense.Moving.Common.Mail.Attachment(PdfStream, "application/pdf", "Welcome.pdf") }



 

Related articles



© ITSENSE AG. Alle Rechte vorbehalten. ITSENSE und CoreOne sind eingetragene Marken der ITSENSE AG.