send exported document by email?

hi guys, i want to send xml, txt, doc p df or any other exported file from FORM directly by email as attachment

anybody did that and what is the easier way that tcpdf thing? i tried but couldn’t success

any easy tutorial or special instructions for this?

Sending any file goes the easiest with PHPMailer if you want to send several pictures and so on. You need to fiddle less in details with it. sc-mail_send is also fine but you can send only one attachement afaik.
http://www.sitepoint.com/sending-emails-php-phpmailer/ for a simple example…

oh rr dear friend, i know about phpmailer but don’t know how to use it along with SC, i am not an expert like you guys :slight_smile:

also wanted to export some report or grid like the one when you click on PDF export for example then send directly by email to some address that user fills in…

i still wounder what will be the main hint to use the exporting the sc file or and how to make it possible

also still reading in the forums but couldn’t success actually

I do this with Swiftmailer ! http://swiftmailer.org/

Well, there is no easy way. The problem is that you can’t catch the exported file with the tools provided and save it on the server.
There is no way from within SC to intercept the generated file other than download it and then upload it.
You have to create those files by yourself.
It is certainly somewhat easier for a grid (there are plenty of classes available) then for a form especially when it comes to iframes.
I think the easiest way would be a feature request to Netmake. :slight_smile: :slight_smile: But that could take some time.

jsb

hello jsb, again glad to read your name and thanks for your time, I understand your point and one thing about “take some time” with netmake is perhaps ages :stuck_out_tongue:

however, this feature is not really urgent or necessary to make it now and all in one click, as you said, can be downloaded and sent, but the feature itself, will be valuable if added by netmake or even easy way to do it…

for me, I still scare when comes to “classes” don’t know how to use php stuff that available online along with SC, but will keep trying to understand the fundamentals at least

once more, looking at myself like one year back till now, jsb, your respectful personality and posts/replies (either to me or in the forums when answering others) is one of the things that encouraged me to go through all the difficult stuff during the last months, I never thought I could reach this far in specific functionalities and certain directions :smiley:

thank you jsb, to Albert, rr, kafe, adz, EricB, Giu, and many other, about a year back I was lost with SC and PHP codes and how to use them, well, I am still lost somehow, but not like that time :smiley:

thanks guys

Hi Mike, did you ever figure this one out ?

Yes, do you want to send an attachment in an email message? or something else?

I think it could be possible:

  1. On scriptinit of the grid write this line: SC_set_PDF_name=‘your filename.pdf’;
    That means you know the file name and location “…/_lib/file/tmp/you filename.PDF”
  2. Now add a button with SC mail send macro by attaching the file. (Still user has to click two buttons one for exporting PDF and other to send mail, if there is any way to call export PDF button programmatically then one button can do the same).

That’s what I’m looking for months without success

why don’t you make the button available only after clicking the first one… or add a code to execute the what other button does after onValidate success or something… sorry didn’t try to produce PDF file and send it, my expereince was sending simple attachment field file by email, and it worked later…

I found no way to execute the code as the pdf button does… and this button has no events
Sorry if I hijack the thread

I’m looking for the same thing Joe, programmatically invoking the export functionality

i wounder guys why you can’t track the button function… can’t you use some sort of tracking what the button does and add it to the code? i would like to try it myself just don’t have the prerequesit or the full scenario nor the time to go through it, if you have a project you can export with mysql dump you can share lets have a look

Hi Mike, I don’t know what the pdf button exactly does. If you copy the link you get this

javascript:%20nm_gp_move('pdf',%20'0',%20'cor')

The browser shows this link

javascript: nm_gp_move('pdf', '0', 'cor')

I was experimenting with that without any success. I just would need a custom button which executes this code and some other php stuff. After that the email things with pdf as attachment would be easy.
For testing Mike you could use the SC own samples -> Grid Applications -> Grig19 customers report for example
Joe

okay, then did you try to create a button javascript type and add that code to see if works manually? I’m not java guru but i see this logic so it must be possible to accomplish

Yes I tried that in the past and it worked. So I created a php button and tried to implement this javascript code which did not work.
I already deleted the code but as I remember I ended the php code in the custom php button with ?> and then put in the javascript code <javascript …> after that I started the php code again with <?php

I don’t know why but this didn’t work in the end

I will try to check but you seem tried all the tricks already :slight_smile: obviously you need some workaround guru or javascript guru to see this thread :slight_smile:

i afraid you need a java guru or workaround guru dude, i will try myself but you seem already used my tricks

i afraid you need a java guru or workaround guru dude, i will try myself but you seem already used the tricks i have in mind