![]() |
Welcome to the Tectite Forums! You can download and get support for our free PHP FormMail (form processor) and other free software. |
|
#1
|
|||
|
|||
|
Hi,
First, FM is working and is a great script. The How-To pages cover how to create a csv formatted email, but not the other bits that I am trying to do. Russell has been patiently trying to help me do the following but probably since I am not experienced with php, I haven't been able to make it work. - FM processes the html form data and creates a separate csv file, this file NOT to be stored in a db. - FM automatically attaches the csv file to the email generated by FM, and does not include the data in the body of the email. My client then loads the csv file directly into their proprietary customer data base. The clients do not want the liability problems of storing sensitive customer info on their db, no matter how secure I can make it. I hope that someone has faced this requirement before and has some ideas on how to modify FM to do it. Regards from chilly New England |
|
#2
|
||||
|
||||
|
Doc,
What exactly are you not able to make happen? Do you get the form email? Does the email have an attachment? George |
|
#3
|
|||
|
|||
|
Quote:
I receive the form email. The text of the email uses the Plaintemplate that I created to send the data in csv format. But I don't want the form data in the body of the email, I want it only as an attachment in csv format. I will encode the attachment with Tectites encoder utilities. Does that make sense? Doc |
|
#4
|
||||
|
||||
|
Doc,
All sounds good. The issue is then getting the csv attachment into your db? In short, the process is straightforward. Assuming you've saved the attachmet, with PHP you can:
George |
|
#5
|
|||
|
|||
|
George,
Sorry if my explanation was not complete. I actually don't want to store the csv in a db. The client only wants to have a csv file delivered to him as an attachment in his email. The csv file with his customer's personal info is then loaded into the client's application. Is there any hope in FM to do this? Doc |
|
#6
|
||||
|
||||
|
Doc,
Apologies for misunderstanding. It's pretty straightforward. My recollection may be incomplete, but the requirements include:
HTML Code:
<input type="hidden" name="mail_options" value="PlainTemplate={csv template file}",{other options} /> <input type="hidden" name="filter_options" value="Attach={attachment file name}" /> <input type="hidden" name="filter" value="null" /> !Good luck George |
|
#7
|
|||
|
|||
|
George,
Success! After adding your code snippet to the form, the email is sent with no text in the body and with a csv file attached. The csv file opens in Excel and it has the correct format as specified in the plain.csv template, so I assume it will load into the client's application. The next step for me is to add spam security and encode/decode (maybe Tectite's Captcha and en/decode) the csv file to keep hackers away from the sensitive info. With great relief that this is working and many many thanks for sharing your knowledge, Doc |
|
#8
|
|||
|
|||
|
<input type="hidden" name="filter_options" value="Attach=csv.csv,KeepInLine" />
<input type="hidden" name="mail_options" value="HTMLTemplate=efileregis.htm,PlainTemplate=csv.csv,TemplateMissing=" /> <input type="hidden" name="filter" value="null" /> I have the above, and I get the email, in html, I also get the csv file, but my problem is that the csv when it opens in excel goes from row 1 to row 20, not filling in row 1 all the way to column 20. It also contains the field NAMES despite every formatting I can think of to strip the names. I just want a plain line of fields, separated by commas, so that the person getting the email can copy and paste it into a combined spreadsheet. does anyone know how to do this? |
|
#9
|
||||
|
||||
|
If I understand correctly, when you open the csv file in Excel you get a two cells: A1: contains all the field names that appear in your template file; and A2: contains all of the entries in a single cell.
To get a single row of just the variables (and no field names above them) you can delete the first row of your template text file. To get each value in a cell, the separator in the text file needs to be the default separator in Excel. I would expect this to be a comma. I just did an experiment and got a single row of variables, each in a separate cell. My template text file begins: "$type","$email","$FirstName"... Hope this is useful. George |
|
#10
|
|||
|
|||
|
no, what I get is one column with 20 rows, with the 'FieldName: field' in each row.....but, my (blank) csv when opened, opens across one row, with 20 columns In fact no matter how I try to format the results, I get the field names included. I was able to get it in one line in html, comma separated results, but the field names tag along and muck up the results.
one thing however, I do not have the quotes around each field, so am going to try that right now. I also have my file named with the extention csv...and I could never understand if I am supposed to have it named as csv or txt thank you so much for your thoughts and help |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Dont send form data, just notify me | psyXonova | Community Support | 2 | 09-Jan-2007 12:01 AM |
| How to generate email, csv and PDF | carsten | FormMail Subscription Support | 0 | 20-Oct-2005 09:32 AM |