Email body from HTML File

Hi All

I have a requirement to send a daily report out from my SXT LTEs. The report is basically content from a web page showing how much data is left in a quote and how long before it expires.

I’ve managed to make a fairly simple script (i’m no scripter!) that pulls the webpage and I can email that as an attachement, but what I really wanted was for the content of that html page to be the body of the email.

Here is my script:

:global done false;
:local date [/system clock get date];
:local time [/system clock get time];
:local filename "4gstatus.html";
;local data [/file get "4gstatus.html" contents;]
:local ebody "4G Report on $date at $time";

:put $ebody;

if ( [:len [/file find name=$filename]] > 0 ) do={
    :put "Found";
    /file remove $filename;
} else={
    :put "Not found";
}

/tool fetch url="http://add-on.ee.co.uk/status" mode=http dst-path="$filename";

:set done true;

:if ( [:len [/file find name=$filename]] > 0 ) do={
    :put "Download ok";
} else={
    :put "Download failed";
}

/tool e-mail send to="myemail@gmail.com" subject="4G Daily report" body=[$data] file=4gstatus.html;

This all works with the exception of the body of the email … it just comes over blank, but the attachment is all good.

Anyone know if this is “doable” ? Alternatively if i could parse the HTML for just the string I wanted that would be even better, but pretty sure ROS doesn’t support grep or similar.

Thanks