- January 30, 2025
- Posted by: Sriram S
- Category: Informatica CAI
Introduction
Many Informatica users need to send emails with attachments as part of their data integration processes. Whether it’s sending reports, alerts, or other important documents, automating this task can save time and reduce errors. This blog post provides a comprehensive guide to using Cloud Application Integration (CAI) and Microsoft Outlook to send emails with attachments. We’ll cover everything from setting up the connection to configuring the email content, empowering you to create a reliable and efficient solution.
Setting Up the App Connection for Email
Configuring an email app connection in Informatica allows seamless integration of email services within process. To create the email app connection, go to the app connection and search email. Provide the appropriate values for each field
Authentication Setup
The connection uses the Password authentication type. Ensure the Authentication field is enabled and provide the email account’s Username and Password for secure access.
Security and Timeout
The Security protocol is set to TLS for encryption, ensuring secure communication. A Connection Timeout of 30000 milliseconds (30 seconds) is configured to handle server delays.
Connection Properties
- Host: smtp.office365.com (Microsoft Office 365 SMTP server).
- Port: 587 (TLS standard port).
- Test Email Address: Used to verify the connection.
- From Email Address: Specifies the sender’s address.
Testing and Publishing
Test the connection to ensure proper configuration. Once validated, publish the app connection.
This setup ensures secure and efficient communication through email within your Informatica environment.
Creating the Process
You can refer to the picture, which illustrates a process consisting of seven steps. Let’s take a brief look at each of them.
Step 1: Start
Create the temporary fields as shown in the picture above, ensuring that each field is assigned its respective data type.
- Text: file, base64File, path
- Attachment: csvFileAttachment
- Connection defined types: emailInputObject, emailAttachment
Set the initial value to the file path of the CSV attachment.
Step 2: Assignment to file
We will assign a value to the file field.
We will assign the formula provided below.
string-join(for $line in fn:unparsed-text-lines($temp.path) return concat($line, ‘ ’), ”)
The formula appends a newline character to the end of each line and stores the CSV data as text.
Step 3: Assignment to base64File
Assign the formula util:base64Encode($temp.file) to base64File. This will convert the CSV data (text) into a Base64-encoded value.
Step 4: Assignment to csvFileAttachment
Assign the formula sff:createAttachmentFromBase64(‘csv_attachment’, $temp.base64File ,’csv/text’)
- csv_attachment : content name
- base64File : encoded file
- csv/text : mime type
This formula converts the base64 value into csv file.
Step 5: Prepare Attachment
In this step, add values for Content and Attachment Name.
Step 6: Email details
Assign values to Recipient Address, Subject, Body, and Attachments.
We have included the emailAttachment that we generated.
Step 7: Send Email Service
Set the Service type as connection and action as sendEmailService.
Finally, save the process and publish it.
Run The Process
Run the process without any input.
The recipient will receive the email with the attachment. By following the steps outlined in this blog, you can successfully configure Informatica Cloud Application Integration (CAI) to send emails with attachments via Microsoft Outlook. This streamlined approach enhances your workflows, enabling efficient communication and automated data sharing. Remember to adapt these steps to your specific needs, exploring the various configurations and options available within CAI to tailor the solution to your unique requirements. Please feel free to reach out to us for your Informatica CAI solution needs.