Forums / Setup & design / Contact form without collected info

Contact form without collected info

Author Message

Marko Žmak

Wednesday 06 December 2006 1:54:38 am

I would like to create a contact form which doesn't collect information, but without collected info, just to send an email, a not to collect any data in the database.

In some previous versions of eZ there was "form/process" for this but I heard (seen) that from some version forward this was obsolete and "ActionCollectInformation" should be used.

Could someone tell me what's the right way to use a contact form just for sennding mail and not ocllecting data?

P.S. I'm using eZ 3.8.6.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Łukasz Serwatka

Wednesday 06 December 2006 2:46:05 am

Hi Marko,

Create a new module with 2 views (form,send). Then you will have full control on it. It should be very easy. form/process is very simple and might not fits for your all needs.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Marko Žmak

Thursday 07 December 2006 3:40:29 am

What I need here is a really simply functionality.

I need to send an email with the data that user entered, and display the name of the node from wich it was sent.

So it seems that form/process has all the functionality I need for this. Also I don't wish to write a new eZ module for such a simply need.

But when I try to use form/process I get error message saying that the module i disabled. How can I enable it and will this module be present in eZ in the future or it will be removed as obsolete?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Marko Žmak

Thursday 07 December 2006 3:48:31 am

OK. I found out how to enable the form module:

http://ez.no/community/forum/install_configuration/form_processing_error

But now I need soemthing else. What template is used to generate the email that is sent?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Christian Johansen

Thursday 07 December 2006 3:54:57 am

Turn on debug output and list of used templates, then send yourself an email, and it will tell you what template it is using :)

Marko Žmak

Thursday 07 December 2006 3:57:10 am

Yes, that was the first idea, I did it before asking for help on the forum. But it doesn't work. I turned on TemplateDebug, and I have template names displayd everywhere but not in the email I receive. Why? How can I find out what template is used for email generation of form/process?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Claudia Kosny

Thursday 07 December 2006 4:08:47 am

Hi Marko

Just check the source of /kernel/form/process.php and you will see that there is no template used at all. The email content is just a concat of (almost) all post variables.

Claudia

Marko Žmak

Thursday 07 December 2006 7:05:06 am

Uh... that's not good. It seems like I will have to use ActionCollectInformation. It has indeed much more possibilities, but here's what's bugging me about it...

I just want to send an email with the data from contact form and not collect it in the database. For this purpose I really don't have any need to have the submited data collected. Actually I don't even want it in the database, because it will just accumulate for no reason, and I'll have to remove the collected info from time to time.

So is there a way of using this action, but without collecting any data? And also without having to write a custome module for it? Some INI setting or similar maybe?

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Claudia Kosny

Thursday 07 December 2006 7:14:27 am

Hi Marko

As I don't know of another built in way to send formdata you either have to put up with infocollection or write your own module.

Actually you just could copy the kernel/form folder into an extension and add the necessary files to make a full module out of this. Then just rewrite the process.php so that it uses a template to format the posted data. 20 minutes work max (unless you need a really fancy template)

Claudia

Łukasz Serwatka

Thursday 07 December 2006 7:16:33 am

Marko, I would choose "new module" way, as suggested before. It is only few lines of code. There is no other way, to catch data and send it via mail in eZ publish beside infocollection or form/process. Based on experience I knew that form/process will be not enough ;) Extension gives even more, since mail content can be tamplate based as well, so can be easily change in future.

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Marko Žmak

Monday 11 December 2006 1:43:47 am

Although I have never before created a custom module, now that I've inspected the eZ module system it seems like writin custom module is not that complicated as I tought. I'll think i'll go for the new module sollution, copy-paste the exsisting code for information collection and remove the piece of code where the data is stored. I'll let you know about the results.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth