Emails Beyond Text: Effortlessly Embed Images with a Single Step!

Use the built-in Mail Step feature to embed images directly into your email body so you can deliver more engaging and impactful content.

The Challenge

In operational workflows, emails are often used to send alerts or notifications as plain text or with attachments. However, you may want to embed images directly within the body of the email, not just as separate files, to improve clarity and create stronger visual impact.

The Solution

With Trinity’s built-in Mail Step function, you can embed images directly into the body of your emails using HTML formatting. The image is first converted into Base64 encoding, and the encoded string is then referenced in the email’s HTML body to display it seamlessly.

Workflow Overview and Steps

Trinity job flows consist of multiple modular steps. This solution combines the External Command Step to encode an image, and the Mail Step to embed it:

Step 1
Create an External Command Step that uses a shell command to convert the image file to a Base64 string. Store the output in a variable.
Step 2
Create a Mail Step, and in the email content field, use HTML syntax to structure the email and insert the Base64 variable as an embedded image source.
Step 3
Execute the job. The email will render the image inline within the message body, as intended.