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

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

Highlighted
KSM
Level 8

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

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

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

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

Thanks,

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

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

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
});

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

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?

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

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.

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

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.

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

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

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

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

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

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