Portal transform (?) 'images to email'

I have a browser view that sends emails (to groups) with content of the current document.

Inside the html, links to the image would be 'resolvedid' which in the email would then be 'http:/../../images/etc/etera.jpg'

What is the best way change all 'internal URLs' (in body_text) ?

No need for changes id you ask me since image urls based on resolveuid will be resolved correctly...or?

no…

When you see a page in Plone, the image tag is

<img src="resolve_something…"/>

When I try to mail the body_text, for example by constructing the mail body with:

 context.text.output

the image URLs are

<img src="../../some/where/my_image.jpg">

I want the link to be:

<img src="http://mydomain.com/some/where/my_image.jpg" />

(since I am importing the source of the email into something else )

So what I really want to know is:

Is there something else I can use than context.text.output which would include the full URL ?

i don't know why images references by UID would be translated to relative URLs...this makes no sense to me.
Anyway....parse the HTMl yourself using an HTML parser and fix the URLs to your needs.

-aj

After some digging I noticed something weird (at least to me):

If I do:

context.text.raw

All imagetags are src="../resolveuid

But if I do

context.text.output

Scales of the images are
src="../resolveuid

while the full image (original size) is

src="http://some.com/full/path/to/image.jpg"

I don't know if this helps, a Transform that use Richtextfield with output_relative_to(context), found in Plone Rest API

Never seen relative link like `src="../resolveuid" ....why would a UID reference contain a relative path component?

… no clue but this is what it outputs:

context.text.output

or

context.text.output_relative_to(context)

produces:

<img alt="" src="../resolveuid/fa288d0a8f9c42e7adf357cd8d65fe98/@@images/image/large" class="image-inline"/>
<p>Before you start exploring your newly created Plone site, please do the following:
<img src="http://localhost:8080/mymime/skjermbilde-2018-03-09-kl-12-28-16.png" title="Skjermbilde 2018-03-09 kl. 12.28.16.png" alt="Skjermbilde 2018-03-09 kl. 12.28.16.png" class="image-inline"/></p>

Maybe is related to this topic?

I don't know why we need to add relative paths to resolveuid, if it works on the root.