Forums / General / contact form on my ezpublish site

contact form on my ezpublish site

Author Message

Kevin Compton

Thursday 11 January 2007 3:36:34 pm

I'm not a developer, well not a code guy but I know a little, but I hired someone to make my site and I needed help figuring out how to change this one feature since hes unavailable at the moment.

The contact form he set up works, however for some reason in the "from" line of the e-mail of any submission from the contact form, no matter who it is or where its sent from, it always has my e-mail, as if I sent it.

Also I wanted to change the format of the output that gets sent, not the information but simply how the information is laid out on the e-mails it generates. The problem is there are spaces between each entry and it makes the print outs to long. So where would I likely edit this?

Thanks for all patience and any help.

Matthew Carroll

Thursday 11 January 2007 9:48:07 pm

You need to add a line to the template that processes sending the emails. Since ez has an extensible template override system and by your own admission you're not a "code guy" you may have a hard time finding the correct template to edit - you may even need to add a new override if the site is using the default at the moment. It may be in override/templates/collectedinfomail/feedback_form.tpl or similar. The line you need to add has to correspond to the field in the form that collects the sender's email address. In one live site of mine, the following works:

{set-block scope=global variable=email_sender}{$collection.attributes.2.data_text}{/set-block}

I hope that helps a little.
Matthew

http://carroll.org.uk

Kevin Compton

Friday 12 January 2007 9:42:06 am

It appears that the default override for that does not exist, so I will have to make one then?

And does that code you put reference to some other file I would also have to create? I'm trying to figure out how the actual format of the output gets deteremined.

Thanks!

Kevin Compton

Friday 02 March 2007 10:12:35 am

Okay I found the TPL that relates to my form, now I will clarify my issue.

The following link is my form:

http://www.cecvp.com/index.php?/plain/contact_us

Now heres my issue, the form is simply not done right I think. Instead of sending me this answer, like it should, for example on "I am interested in" (assuming someone chooses just two things):

I am intertested in: electronics, vibration transducers

Instead, my idiot programmer made it so that each item on the form, without exception, is a line with a colon. So it looks like 12 pages of this:

name:

catalog:

Vibration transducer:

etc

you get the idea. This form should print out in 1 page, 2 max. So my question is, how do I fix it? Any good tutorials? I don't want to change the form itself, just the manner in which it is formatted.

So heres the code:


{set-block scope=root variable=subject}{"Collected information from %1"|i18n("design/base",,array($collection.object.name|wash))}{/set-block}

{set-block scope=root variable=email_receiver}{$object.data_map.recipient.content}{/set-block}

{* Set this to redirect to another node
{set-block scope=root variable=redirect_to_node_id}2{/set-block}
*}

{"The following information was collected"|i18n("design/base")}:

{section name=Attribute loop=$node.data_map}



{if and(ne($Attribute:item.contentclass_attribute_name,'Recipient'),
ne($Attribute:item.contentclass_attribute_name,'Name'),
ne($Attribute:item.contentclass_attribute_name,'Description'))}

{if eq($Attribute:item.contentclass_attribute_name,'Vibration Transducers')}
	<br /><strong>I am interested in:</strong><br />
{/if}

{if eq($Attribute:item.contentclass_attribute_name,'Utility')}
	<br /><strong>Company Description Profile:</strong><br />
{/if}


{$Attribute:item.contentclass_attribute_name|wash}:
{attribute_result_gui view=info attribute=$:item}

{/if}
{/section}

Kevin Compton

Tuesday 06 March 2007 9:59:08 am

hello??

Claudia Kosny

Tuesday 06 March 2007 11:17:56 am

I think the problem is that the content of the attribute is not checked before it is printed so all attributes are printed no matter whether they are checked or not.

Without knowing the type of the attributes it is hard to say how to check whether something is selected or not. If the attribute is an checkbox you can try to change the almost last lines of your template like this:

{if $Attribute:item.content}
  {$Attribute:item.contentclass_attribute_name|wash}:
  {attribute_result_gui view=info attribute=$:item}
{/if}

This should check the content of the attribute and only display the next lines, if there is some content, meaning something is selected.

Please note that I have NOT tested this and it might not work. So if you have to try this on your live server please try sometime late at night and make a backup of the template beforehand...

You can also try to remove some linebreaks in the template and have a look whether this makes the email a bit more compact.

Claudia

PS: And please stop complaining about your 'idiot' programmer - sue him or do whatever else might make you happy but please leave the forum out of it.

Kevin Compton

Friday 09 March 2007 11:09:13 am

Claudia, thanks for the help but it didn't work. I'm still getting the same results. They are check boxes but all I get for them, rather I check them or not, is a blank space.

heres the actual form itself:

Here is I get to me everytime. (Ignore the filler text in the in the text fields). I also want to get rid of all those spaces in between, how do I do that?


The following information was collected:
Full Name:
testing the testicles

Subject:
hello

Message:
cha cha cha

Email:
[email protected]

Title:


Department:


Company:


Address:
k;lk

City, State:
jl;kj;l

ZIP:
kjl;kljj

Country:
lklkj

Phone:
lkjlkj

Fax:


Preferred method of contact:


Send Catalog:


Vibration Transducers:


Accelerometers:


Monitoring Equipment:


Electronics:


Diagnostic Equipment:


Strain Gauge Bonding Services:


Utility:


Process Industries:


Aviation:


Engineering Firm:


Marine:


Government Agency/Military:


Research and Development:


Manufacturing Company:


Other:


(please indicate)::
&lt;Type Other Company Profile Here&gt;

Kevin Compton

Friday 09 March 2007 11:10:20 am

sorry forgot to link the form, here it is: http://www.cecvp.com/index.php?/plain/contact_us

Kevin Compton

Tuesday 13 March 2007 11:51:48 am

not all at once, everyone.

Jon Staines

Friday 16 March 2007 6:51:00 am

Try something like this in the feedback form template:

{set-block scope=root variable=subject}{"Collected information from %1"|i18n("design/base",,array($collection.object.name|wash))}{/set-block}
{set-block scope=root variable=email_receiver}{$object.data_map.recipient.content}{/set-block}
{set-block scope=global variable=email_sender}{$collection.attributes.3.data_text}{/set-block}
{* Set this to redirect to another node
{set-block scope=root variable=redirect_to_node_id}2{/set-block}
*}
{"The following information was collected"|i18n("design/standard/content/edit")}:

{section name=Attribute loop=$collection.attributes}
{if eq($Attribute:item.contentclass_attribute_name,'Vibration Transducers')}
<strong>I am interested in:</strong><br />
{/if}
{if eq($Attribute:item.contentclass_attribute_name,'Utility')}
<strong>Company Description Profile:</strong><br />
{/if}
{$Attribute:item.contentclass_attribute_name|wash}:
{attribute_result_gui view=info attribute=$Attribute:item}<br />
{/section}

Although you might need to change the number 3 in the set-block scope=global variable=email_sender line to whatever you have currently.