Embedding Images Using Comms-data Tag
Communication Cloud Service lets you include images from JSON payload into Content by using <comms-data>
tag. Supported file types include JPG, PNG and SVG image types.
Example:
You may be using images from your system that you want included in your generated output along with other information. In the example below, a cancelled cheque image will be added to the communication to your customer.
Sample Assembly Template
{
{
"$$Id": "PackageName",
"Fields": [
{
"Name": "CancelledCheque",
"Path": "$.CancelledCheque"
}
]
}
Sample Content
Note:
To resize the image, you can use the Transform style attribute. For more information, refer topic Style Attributes in Communication Cloud Service
Dear User,
We are hereby enclosing the provided cancelled cheque for your confirmation.
<comms-data>$Data{"Id":"CancelledCheque", "Type":"Image"}</comms-data>
Thank You
Sample Preview data
{ "CancelledCheque": "replace this with the base64 encoded data of the image file" }