Extra logic for a feedback form

Author Message

Ronan Limon Duparcmeur

Friday 02 April 2010 9:16:36 am

After hitting my head against the wall and blowing off much steam on Twitter, I've finally been able to add some logic to what should have been a simple feedback form. For the record, here is my problem and how I solved it.

One of our eZP-powered website features a simple feedback form. The catch ? Instead of sending an email, the submitted data has to be used to fill our CRM. This involves consuming a webservice, and thus some backend code.

Since triggers aren't available on feedback forms (or, if they are, I just couldn't figure it out), we had to find another way. A custom module+action was out of question, so instead, we choose to add the extra logic in the feedback email template.

So, basically, what we do is activate the sending of feedback emails (even though we don't want them), and in the overridden template for this email, we call a custom template operator. This operator, in turn, handles the call to the CRM's webservice.

This is an ugly solution to a problem that shouldn't even exist in the first place. It may not be the best solution, but hey, at least the problem is solved for now.

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 10:29:25
Script start
Timing: Jan 18 2025 10:29:25
Module start 'layout'
Timing: Jan 18 2025 10:29:25
Module start 'content'
Timing: Jan 18 2025 10:29:26
Module end 'content'
Timing: Jan 18 2025 10:29:26
Script end

Main resources:

Total runtime0.9480 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 587.9141152.6250
Module start 'layout' 0.00520.0025 740.539139.4453
Module start 'content' 0.00770.9390 779.9844401.1719
Module end 'content' 0.94670.0013 1,181.15638.1641
Script end 0.9480  1,189.3203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3264160.0002
Check MTime0.00120.1317160.0001
Mysql Total
Database connection0.00090.094210.0009
Mysqli_queries0.912296.2255460.0198
Looping result0.00040.0448440.0000
Template Total0.919497.020.4597
Template load0.00220.227820.0011
Template processing0.917296.756520.4586
Template load and register function0.00030.028610.0003
states
state_id_array0.00070.076810.0007
state_identifier_array0.00080.085120.0004
Override
Cache load0.00180.185990.0002
Sytem overhead
Fetch class attribute can translate value0.00060.062210.0006
Fetch class attribute name0.00150.153810.0015
XML
Image XML parsing0.00010.015310.0001
class_abstraction
Instantiating content class attribute0.00000.000910.0000
General
dbfile0.00060.0629100.0001
String conversion0.00000.000740.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
2content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/strong.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/strong.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 6
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs