cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can change your system assigned username to something more personal in your community settings. X

need to send grid data from mashup into the e-mail

KSM
14-Alexandrite
14-Alexandrite

need to send grid data from mashup into the e-mail

I have one requirement, I want to send the grid data to the user through e-mail. what is the feasible solution. 

13 REPLIES 13

Just build and email with HTML Content and send it with the MailExtension

KSM
14-Alexandrite
14-Alexandrite
(To:CarlesColl)

Thanks,

could you please elaborate little bit and if any sample code you have .

You just need to fill a String with the desired html format and send it with a Thing which derived MailServer ThingTemplate (that you will find on Marketplace Extension: https://marketplace.ptc.com/apps/193028/mail-extension )

 

var emailContent = "<html><body>\
 <table>\
  <tr><td>Column1</td><td>Column2</td></tr>\
  <tr><td>RowValue1</td><td>RowValue2</td></tr>\
</table></body></html>"

Things["YourMailServerThing"].SendMessage({
 from: "youremail@yourmailserver",
 to: "email_destination@anothermailserver",
 subject: "Awesome email, with a table :P",
 content: emailContent
});
KSM
14-Alexandrite
14-Alexandrite
(To:CarlesColl)

Thanks carles, but for filling that content definitely we need to get that grid data into the service first, then only it will possible right?

Yes of course, you have to build a service which accepts the Infotable ( if you fill de Grid, you already have a service that fills the grid, just get this output and use it as input of the SendGridToEmail service ) and sends it through email.

KSM
14-Alexandrite
14-Alexandrite
(To:CarlesColl)

Thx Carles,

 

I have binded the selected rows property of a grid to my service input which is of type infotable. now i want to check whether that input has that selected rows data or not, that how should I check. is it possible by setting logger.info or something else.

You have to bind from the right side ( service Selected Rows, the one that fills the grid) not from the Grid.

KSM
14-Alexandrite
14-Alexandrite
(To:CarlesColl)

I have done but how can I check whether I got that infotable in my input or not? 

logger.info("Number of rows "+yourInputInfotableName.rows.length);

KSM
14-Alexandrite
14-Alexandrite
(To:CarlesColl)

No Luck, something may be went wrong at bindings :(

KSM
14-Alexandrite
14-Alexandrite
(To:CarlesColl)

Hi Carlos, 

assume there is one service and its output type is infotable and I want to take this output as input for another service then I need to mention the name infotable, at that cas what would be the name of infotable , is it a datashape name or service name? where would i fond infotable name 

I'm sorry I don't get the point, you just need to bind the output from the service to the input of the other server within the mashup, no need to set any name.

KSM
14-Alexandrite
14-Alexandrite
(To:CarlesColl)

I have binded as you said only but that service is having inputs also how should I bind that inputs also? could you please help me out?

Top Tags