Send by E-Mail a control Report HTML data


Adrian Brookbank

Hi David,

Am using a cordova email plugin, what I need is to be able to embed the HTML table and data from my Report into the body of the email.

The above gets me the current view 'Name' within the email which works...

How would I embed the current Report within the email..?

Any help would be appreciated.

Thanks,


DecSoft

Hello Adrian,

If what we get is the HTML of the table, we can get it using a bit of Javascript/jQuery like the below:

However, I am not sure if something like that can work, because, that HTML contains some stuff that may cause some problems in the E-Mail's body, or the HTML table may don't appear exactly like you wanted. You can try it, Adrian.

If that do not work, maybe you can iterate over the Report's Data variable, and compose the HTML table / E-Mail body by yourself: this allows to take care about the HTML that we place in the E-Mail's body.

Another possible way is to use the app's server: if we have the Report's Data / Records available in the server's side (for example, if they come from a database), or just by sending the data that we need to use, we can send the E-Mail from the server side.

Probably the plugin that you refer (who work in the client side) do not really send the email, but just prepare it. Well, the server side solution is more directly, that is, a server can directly send the emails, without the user intervention.

Please, consider the above and put here any further questions that you can have, Adrian.



Adrian Brookbank
Thanks David, very helpful as ever - I'll give it a go and update.

DecSoft

Hello Adrian,

No problem. There can be more things to be noted, for example, I am not sure if the plugin that you try to use allows HTML bodies. If so, that's ok. If not, the server side come again here as a posible best option: for example, using PHP, it's quite easy to prepare HTML and plain text emails, and, as I say before, directly send the emails, and not relies on a thirdparty app and the user intervention.

It's more or less clear that I love the server side? :-) Well... certainly the server side allows to do things that we can do in the client side, so, must be an option to consider! Of course, if your choosed plugin support HTML bodies, or that is just what you wanted, that's not a problem: just choose the best solution for your needs.



Adrian Brookbank
Hi David, var html = $('#Report1 table').html(); Worked, nice and simple. Just some CSS to work on now. Thanks again.

DecSoft

Hello Adrian,

You're welcome! :-)



Adrian Brookbank
Hi David, How can I reference this ' [TableHTML] ' in JS? / Rootscope?

DecSoft

Hello Adrian,

Yes; I think you search for "window.App.RootScope.TableHTML".



Adrian Brookbank
Thanks David.

DecSoft

You're welcome Kermit... ops, sorry, Adrian. :-)

P.S. You can use Gravatar to place your own image here in the forum. :-)



Adrian Brookbank
Yes I will get around to changing that, however I do like the Muppets!

DecSoft
Yes I will get around to changing that, however I do like the Muppets!

The best reply. :-)


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.