Skip to main content
15-Moonstone
July 4, 2018
Question

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

  • July 4, 2018
  • 13 replies
  • 4321 views

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

    13 replies

    1-Visitor
    July 4, 2018

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

    KSM15-MoonstoneAuthor
    15-Moonstone
    July 4, 2018

    Thanks,

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

    1-Visitor
    July 4, 2018

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