This topic is locked

Using Frames in the Email Reader Works Better

6/20/2022 7:54:01 PM
EmailReader template
W
WisTex author

For those of you using the Email Reader template, it seems to work a lot better if you view the email body as an embed. Otherwise you can get some strange rendering.

What I did was create new new view that only shows the body of the email. No header, footer, sidebar, buttons, or anything. Just the body.

Then on the default view, I embeded that view.

I created a code snippet where I wanted the body of the email to appear.

global $pageObject;
$record = $pageObject->getCurrentRecord();
// print_r($record);
echo '<embed
src="mail_messages_view.php?editid1=' . $record["id"] . '&page=view3"
style="height:600px;width:100%;border:none;overflow:hidden;"></embed>';

I would prefer that the iframe expands to the full height of the body, but I can't seem to find any code that works. If anyone knows of some javascript or other code that would change the height of the iframe to the height of the email body, that code would be helpful to me. Thanks.

In the meantime, this is usable for viewing emails.

W
WisTex author 6/20/2022

Another tip: Add the following code to the <head> of the view that shows only the body:

<base target="_blank">

This will make all of the links in the <embed> open in a new window.

Don't put it in other views, otherwise it messes up the navigation.

It works on most emails, but some it doesn't work on, for some reason.