Email table contents

Email table contents

isatyamisatyam Posts: 3Questions: 0Answers: 0
edited March 2014 in TableTools
Hi,

I am using datatables and tabletools for my project. So far it has been very easy to implement everything.
I was wondering if there is a possibility to add an email as pdf/xls button, so that table contents can be emailed to users as attachments?
http://live.datatables.net/joxuqiq/1/edit
Thanks for a great plugin!

-Satyam

Replies

  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Sure - but it will take a little bit of custom code as there is no way to send an e-mail from the client-side. You'll need to get the data from the table like the other buttons do, and then submit it as an Ajax request to the server, which would in turn send the e-mail.

    Allan
  • isatyamisatyam Posts: 3Questions: 0Answers: 0
    Hi Allan,

    I am trying to implement this button in a wordpress page. The wp_mail api(http://codex.wordpress.org/Function_Reference/wp_mail) accepts attachments as a parameter. How do I find the path for the generated pdf file?

    Thanks!
    Satyam
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    The pdf is created not he client-side, so I can't imagine it would be of much use to a server-side script. You'd need to write a little script to create the PDF not he server-side.

    Allan
  • isatyamisatyam Posts: 3Questions: 0Answers: 0
    Is there some resource already available for creating the pdf on the server side?
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin
    Loads of options ( https://www.google.co.uk/?q=php+create+pdf#q=php+create+pdf - update for whatever server environment you are using) - but not specifically for DataTables since any generic script will do.

    Allan
This discussion has been closed.