2

I'm writing a custom TBB in C# specifically for an email page used in our Outbound Emails.

I've come across difficulties with Gmail in rendering my images so I wrote a small console app to test an idea of embedding the image straight into the markup in order to avoid Google's proxy server and image caching.

The premise of the TBB is to effectively retrieve the path of the published image along with the correct domain. Download the image (small social media icons) and convert the data into Base64 encoding. Additional processing and this is now ready to be embedded to the markup.

The problem is that when retrieving the path of an icon instead of getting:

http://mydomain.site.com/image/test.png

I would get:

http://environment-cms/Preview/.../test.png

Accessing the second link is throwing 401 (Unauthorized) and I don't want to add authentication information as this will be the likely case with every environment.

Is there a way to retrieve the published path of these icon so that I may retrieve the image?

Any help would be appreciated.

1 Answer 1

3

Why do you need to publish the image if you're just going to embed the data directly in your email? You can access the binary data of a multimedia component straight from the Tom.Net API instead using:

Component.BinaryContent.GetByteArray()

Or

Component.BinaryContent.WriteToStream()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.