Quantcast
Channel: VMware Communities : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 180259

sendMessage with logo image in the content using local file only

$
0
0

Hello there,

 

I'm a neophyte to vCO and very much interested to learn developing workflow. I encountered issues which I can't figured-out how to make it work (sending message with office logo in the email) using local file only where my images stored in the vCO dir (e.g. /var/vco/images). Configuration file /opt/vmo/app-server/server/vmo/conf/js-io-rights.conf has already been updated appended /var/vco/images/ with read and execute (rx) permission.

 

In my Scriptable task scripting I have this script as shown:

 

var tempDir = System.getTempDirectory();
var headerLogo = new MimeAttachment(System.appendToPath(System.getTempDirectory(), "d_Header.jpg"));
var contentHTML = "<html><body><img src=\"" + headerLogo.name + "\" alt=\"headerLOGO\"/> </body></html>";
var message = new EmailMessage();

if ( smtpHost != null && smtpHost.length > 0 ){
message.smtpHost = smtpHost;
}
:
:
:
if ( fromAddress != null && fromAddress.length > 0){
message.fromAddress = fromAddress;
}

message.toAddress = toAddress_Support;
message.subject = subject;

content = contentHTML;

message.addMimePart(content,"text/html; charset=UTF-8");

message.sendMessage();

 

When I started my workflow I was able to received my email being sent, however, the logo doesn't appear. When I checked the content string Value I found out that the img src in my html tag not assigned to the right path (supposedly "/var/vco/images/d_Header.jpg") as shown in the screenshot below:

 

contentValue_using_getTempDir_method.jpg

What might be I missed here? Any help is very much appreciated.

 

Thank you.

 

Regards,

 

junix


Viewing all articles
Browse latest Browse all 180259

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>