Question

Send Attchment from Blob Url

  • 18 March 2024
  • 4 replies
  • 31 views

Badge +1

Hi Team,

We have requirement, we have uploaded the document on Azure Blob storage and referencing the path in our DB.

Now we would like send the all document for the the service request as a attachment in the email. Can you please let me know how we can achieve this. There might be multiple attachment for the request.

 

 


4 replies

Userlevel 2
Badge +7

My assumption is that you want to do this from within the workflow.

 

I would recommend that you create a custom broker that can convert the blob into K2 SmartObject friendly format. You will need to convert the binary data to a base64 encoded string.

e.g. <file><name>My Document.pdf</name><content>iVBORw0KGgoAAAANSUhEUgAAADAAAAxxxxx</content></file>

You can then call the SmartObject to attach the files to your email.

Badge +1

Hi Nics,

Thanks for your reply. Is there any other way we can handle this? 

Userlevel 2
Badge +7

You will need to go with the custom broker approach in this case as SmartObjects cannot handle files in binary format.

You can use either a static custom broker or an endpoint assembly broker for this “The endpoint assembly broker may be the simplest approach as it has no K2 dependencies”.

A third possibility is to create a .net core REST service that K2 can consume that wrappers the Azure BLOB storage API. The API would need to expose a Swagger 2.0 file for the K2 REST Broker to consume.

Userlevel 5
Badge +20

Hi @Niks_89 
Did these replies help solve your question?

Reply