Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I am using the SendMessage service of a mail server thing. The following syntax will show the image in an email if I bring it up on my iPhone, but not if I open it up on my PC. Anyone know why? Also, how do I get the URL of a media entity? This is a random test url that I used here but I need to be sending a media entity picture in the email and I don't see where the url can be found.
Thanks in advance for the help. (some info replaced with astericks)
Jenna
var params = {
cc: undefined /* STRING */,
bcc: undefined /* STRING */,
subject: source + "-" + CustomerName + "- " + "Red Humidity Alarm = " + Things[source].CellHealthTestTankHumidity /* STRING */,
from: "***@***.com" /* STRING */,
to: "***@****.com" /* STRING */,
body: eventData.description +
"<br> TALKING POINTS:" +
"<br> ****** was notified of an issue concerning the high pressure system and will be sending a FSE out to correct" +
"<br> the concern immediately." +
"<br> **************************************************************************************************" +
"<br> The CASE generated for this customer should have the following PSCA codes:" +
"<br> - Problem Code - High pressure system" +
"<br> - Symptom Code - Humidity alarm" +
"<br> - Cause Code - Dryer" +
"<br> - Action Code - Replace Dryer" +
"<br> **************************************************************************************************" +
"<br> *******FSE Resolution Steps to determine the issue.******" +
"<br> Determine if the site is currently using UL or Non UL dryers? " +
"<br> <img src=\"https://www.binarymoon.co.uk/wp-content/uploads/2012/04/draw-something-unicorn-e1334932907258.png\" alt=\"Dryer Image\" style=\"width:128px;height:128px;\">" +
"<br> We will need to validate the following if not already done so:" +
"<br> 1- Clean Heat exchanger. You will need to remove it and separate from the fan to clean. See PM document for detailed instructions." +
"<br> 2- Validate the water level in Bulk Water site window is no more than 5/8 full and the hose going into the evaporator is not kinked or restricted" +
"<br> 3- Validate the Fan on Heat Exchanger is operating correctly and properly oriented " +
"<br> 4- Length of time to charge the HP from 0 to 90" +
"<br> 5- Cut-in and Out pressures for Compressor on the Condor " +
"<br> 6- Validate the condition of the compressor Intake Filter" +
"<br> 7- Validate the condition of the Compressor Cooling Filter" +
"<br> 8- Validate that there is a small amount of air being discharged out the desiccant tube not in use and switches every 30 seconds (see KCS article for testing)" +
"<br> 9- On UL style" +
"<br> \t a. Verify the muffler is not restricting the air flow" +
"<br> \t b. Is there a lot of humidity in the Tube?" +
"<br> 10- Change the Mist Filter" +
"<br> 11- Change the Bulk Water Filter"
/* HTML */
};
// no return
Things["****DeviceNotifier"].SendMessage(params);
Solved! Go to Solution.
This is what I did for a work around:
1. Create an app key to use specifically for the service used to send the email and then limit the app key's permissions to only allow it to be used for this
2. Use this to send emails with the image attatched <img src="https://localhost/Thingworx/MediaEntities/DeviceIcon?appKey=xx1xx76-x8x0-4261-9493-xx1x2dxx50b9" alt="Image" width="75" >
The app key attached to the url essentially is automatically authenticating anyone who receives the email (hence why you want to limit its permissions for only this use)
Jenna, you can get to your MediaEntity by going to localhost/Thingworx/MediaEntities/Name_of_your_Entity. I'm not sure if adding a link to a media entity would work (in this use case), because you would need to authenticate into ThingWorx for this entity to be displayed.
Is there a way to display a media entity in an email? Because I've tried that url and you're right it is a broken image when sent. Is there a way to achieve this?
Anything that goes through ThingWorx would require you to authenticate. Even if you have an image file in your repository, and then add a link, it will still require you to authenticate. So unfortunately for your email use case, I don't think using a ThingWorx resource would be a viable option. You would probably need to host the image on a different site and then use the external url in your email.
This is what I did for a work around:
1. Create an app key to use specifically for the service used to send the email and then limit the app key's permissions to only allow it to be used for this
2. Use this to send emails with the image attatched <img src="https://localhost/Thingworx/MediaEntities/DeviceIcon?appKey=xx1xx76-x8x0-4261-9493-xx1x2dxx50b9" alt="Image" width="75" >
The app key attached to the url essentially is automatically authenticating anyone who receives the email (hence why you want to limit its permissions for only this use)
Jenna,
Any update on this? Was Kylie Sauter's post helpful? If so, could you click on the "correct answer" button and let us know?