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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 22:33:30
Script start
Timing: Jan 18 2025 22:33:30
Module start 'layout'
Timing: Jan 18 2025 22:33:30
Module start 'content'
Timing: Jan 18 2025 22:33:31
Module end 'content'
Timing: Jan 18 2025 22:33:31
Script end

Main resources:

Total runtime1.0945 sec
Peak memory usage4,096.0000 KB
Database Queries85

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.0313152.6406
Module start 'layout' 0.00500.0017 740.671939.4609
Module start 'content' 0.00671.0861 780.1328710.6328
Module end 'content' 1.09280.0016 1,490.765624.1563
Script end 1.0944  1,514.9219 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00290.2647160.0002
Check MTime0.00130.1203160.0001
Mysql Total
Database connection0.00080.070910.0008
Mysqli_queries1.013292.5724850.0119
Looping result0.00090.0824830.0000
Template Total1.066297.420.5331
Template load0.00230.206720.0011
Template processing1.064097.211520.5320
Template load and register function0.00010.009010.0001
states
state_id_array0.00100.087310.0010
state_identifier_array0.00210.188420.0010
Override
Cache load0.00210.1925480.0000
Sytem overhead
Fetch class attribute can translate value0.00090.082040.0002
Fetch class attribute name0.00110.1031130.0001
XML
Image XML parsing0.00140.123540.0003
class_abstraction
Instantiating content class attribute0.00000.0038190.0000
General
dbfile0.00100.0873260.0000
String conversion0.00000.000540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
11content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 32
 Number of unique templates used: 5

Time used to render debug report: 0.0002 secs