Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 06-26-2006 13:58:13

noescape
Member
Registered: 04-21-2006
Posts: 67

Contact Form

Hi all,

Question for you. I'm wanting to use the contact form included with ccp51 rather than customers having to use there own email program to contact us.

All works apart from the following fields are used:

First Name
Last Name
Email Address
Telephone No

I don't however want to use the Telephone No option as it will promote customers to ask for a call back and we are an email support service only.

What i wanted to do rather than just leaving a blank space was provide a drop down menu where by the customer can choose the department their query is most suited to. Obviously this doesn't already exist as an option in ccp51 but was wondering if anyone can offer some advice into how to do this and create the required information.

In the drop down expect options like:

Sales
Accounts
Trade

etc.

Thanks all in advance, i really do appreciate the help given

Offline

 

#2 06-26-2006 15:13:26

dh783
Member
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Contact Form

You can change the contact form in Admin "HTML Pages & Element>Manage HTML Pages (System)>Contact" at:

Code:

<TD VALIGN="TOP"><FONT FACE="(CGIVAR)html_small_font_face(/CGIVAR)" SIZE="(CGIVAR)html_small_font_size(/CGIVAR)" COLOR="(CGIVAR)html_small_font_color(/CGIVAR)"><B>Telephone Number <FONT COLOR="(CGIVAR)html_notnull_font_color(/CGIVAR)"><B>(CGIVAR)html_notnull_character(/CGIVAR)</B></FONT></B><BR><BR></FONT>

<INPUT TYPE="TEXT" NAME="tracking_phone" SIZE="20" VALUE="(CGIVAR)fd_tracking_phone(/CGIVAR)"></TD>

But to do what you want to do you will have to create new fields in tracking.csv and trackitem.csv and do some perl codeing so that when a customer selects the option it will get the information into the database.

John

Offline

 

#3 06-26-2006 17:04:15

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Contact Form

This isn't too tough.  Since you want to eliminate the phone number anyway, let's just put the new dropdown for the destination in that spot.  To do that, go into the admin, as John described, and change:

Code:

<TD VALIGN="TOP"><FONT FACE="(CGIVAR)html_small_font_face(/CGIVAR)" SIZE="(CGIVAR)html_small_font_size(/CGIVAR)" COLOR="(CGIVAR)html_small_font_color(/CGIVAR)"><B>Telephone Number <FONT COLOR="(CGIVAR)html_notnull_font_color(/CGIVAR)"><B>(CGIVAR)html_notnull_character(/CGIVAR)</B></FONT></B><BR><BR></FONT>

<INPUT TYPE="TEXT" NAME="tracking_phone" SIZE="20" VALUE="(CGIVAR)fd_tracking_phone(/CGIVAR)"></TD>

to:

Code:

<TD VALIGN="TOP"><FONT FACE="(CGIVAR)html_small_font_face(/CGIVAR)" SIZE="(CGIVAR)html_small_font_size(/CGIVAR)" COLOR="(CGIVAR)html_small_font_color(/CGIVAR)"><B>Recipient<FONT COLOR="(CGIVAR)html_notnull_font_color(/CGIVAR)"><B>(CGIVAR)html_notnull_character(/CGIVAR)</B></FONT></B><BR><BR></FONT>

<SELECT NAME="recipient">
<OPTION VALUE="sales">Sales</OPTION>
<OPTION VALUE="accounts">Accounts</OPTION>
<OPTION VALUE="trade">Trade</OPTION>
</SELECT>
</TD>

Then, you will need to edit the file /cgi-bin/ccp51/library/modules/ste_mail.pl.  First, FTP the file down to your local machine, using ASCII transfer mode.  Make a copy and store it in a safe place, just in case.  Then, edit the file in a plain text editor and change:

Code:

#########
######### This routine sends contact messages.
#########

to:

Code:

#########
######### This routine sends contact messages.
#########

$fd_recipient = $q->param('recipient');

if ($fd_recipient eq "sales") {
  $destination_email = "sales\@yourdomain.com";
} elsif ($fd_recipient eq "accounts") {
  $destination_email = "accounts\@yourdomain.com";
} elsif ($fd_recipient eq "trade") {
  $destination_email = "trade\@yourdomain.com";
} else {
  $destination_email = $site_owner_email_address;
} ## end of if statement

Don't forget to fill in the actual email addresses involved and use the backslash before the @ sign in the addresses or it won't work.  Then, a little further down, look for the line:

Code:

&vars_mailer($site_owner_email_address,$fd_tracking_email,$subject,$mail_display);

Change the above line to:

Code:

&vars_mailer($destination_email,$fd_tracking_email,$subject,$mail_display);

Save the file and upload it back to the server (in ASCII mode still).  That should about do it.  You can add additional items to the dropdown if you'd like - you can see the pattern in the HTML in the element editted in the first step.  If you do that, you'll also need to add the corresponding additional lines to the if statement in ste_mail.pl - again, just follow the pattern that's there.  I gave this a run on my test site and it seemed to work fine.  But of course, give it a good test first and go back to your backups if something doesn't work right.

Rachael


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#4 06-27-2006 06:11:05

noescape
Member
Registered: 04-21-2006
Posts: 67

Re: Contact Form

Rachael/John,

Thanks for the replies. I'll give that a go, but one thing, i will actually be using the same email address for all the correspondance, but want the contact form to appear as if its a specific department hense the sales, trade, accounts etc option.

With this being the case, do i need to do anything differently, i.e. changes things in ste_mail.pl?

Offline

 

#5 06-27-2006 07:16:48

noescape
Member
Registered: 04-21-2006
Posts: 67

Re: Contact Form

I've just done the first part in 'HTML Elements' and selected the departments i want to use as below:

<TD VALIGN="TOP"><FONT FACE="(CGIVAR)html_small_font_face(/CGIVAR)" SIZE="(CGIVAR)html_small_font_size(/CGIVAR)" COLOR="(CGIVAR)html_small_font_color(/CGIVAR)"><B>Department<FONT COLOR="(CGIVAR)html_notnull_font_color(/CGIVAR)"><B>(CGIVAR)html_notnull_character(/CGIVAR)</B></FONT></B><BR><BR></FONT>

<SELECT NAME="recipient">
<OPTION VALUE="general">General Enquiries</OPTION>
<OPTION VALUE="accounts">Existing Customer</OPTION>
<OPTION VALUE="trade">Trade Enquiries</OPTION>
<OPTION VALUE="testimonials">Submit a Testimonial</OPTION>
<OPTION VALUE="link">Request a Link Exchange</OPTION>
</SELECT>
</TD>

I attempted to send the email (because i just want to use the same 'site_owner' email) and it comes back with:

You did not complete all required fields before clicking the Send button. Please try again.

What else do i need to change? I've noticed that the ste_mail.pl file already has this inserted:

#########
######### This routine sends contact messages.
#########

$fd_message = $q->param('message');

$subject = "";

Offline

 

#6 06-27-2006 07:39:43

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Contact Form

Sorry about that.  We need to make the phone number not a required field in ste_mail.pl - I forgot that I had done that some time in the past.  To do that, edit ste_mail.pl and find the line:

Code:

if ($fd_tracking_firstname eq "" || $fd_tracking_lastname eq "" || $fd_tracking_phone eq "" || $fd_tracking_email eq "" || $fd_message eq "") {

Change the above line to:

Code:

if ($fd_tracking_firstname eq "" || $fd_tracking_lastname eq "" || $fd_tracking_email eq "" || $fd_message eq "") {

Since you're sending all the mail to the site owner address, you don't need to do the rest of the mods in ste_mail.pl - this one should take care of it.  Sorry for the oversight.

Rachael


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#7 06-27-2006 09:16:54

noescape
Member
Registered: 04-21-2006
Posts: 67

Re: Contact Form

Hi Rachael, thanks again...that appears to work as far as it processes the contact form and i receive the emails, but the next step is...

The email reads:

The following information was just submitted via the MyDomain.com Contact Form.

First Name: John
Last Name: Smith
Email Address: john.smith@whatever.com
Telephone Number:

message blah blah blah

but doesn't provide details of the department their enquiry is relevant to and still includes the space for a telephone number. How can i over come this?

Offline

 

#8 06-27-2006 09:24:49

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Contact Form

You're welcome.  To make your changes, in ste_mail.pl, in the subroutine ste_mail_contact_proc (the first one), change:

Code:

$fd_message = $q->param('message');

To:

Code:

$fd_message = $q->param('message');

$fd_recipient = $q->param('recipient');

Then, go into your admin area, under HTML Pages & Elements -> Manage Mail Elements and click the update link for the Contact Message element.  Look for:

Code:

Telephone Number:  (CGIVAR)fd_tracking_phone(/CGIVAR)

Change the above line to something like:

Code:

Department:  (CGIVAR)fd_recipient(/CGIVAR)

I haven't tested it, but I'm pretty sure that will do the trick.

Rachael


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#9 06-27-2006 11:04:18

noescape
Member
Registered: 04-21-2006
Posts: 67

Re: Contact Form

Thanks again and again Rachael, that certainly did the trick. I had to amend the 'short names' for the departments to match the full desciptive names as the short is what was shown on the email, but thats all.

I was wondering though (not again!), is there a way of including an option for a subject in the contact form and that being added to the subject in the email too? If its a lot of coding, don't worry about it. big_smile

Offline

 

#10 06-27-2006 11:06:39

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Contact Form

You're very welcome.  Adding a subject is a bit of coding, but not too much.  And you're in luck - I've already posted a mod for it in the cool mods and hacks section of the forum.  You can find it .

Rachael


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#11 06-27-2006 12:33:59

noescape
Member
Registered: 04-21-2006
Posts: 67

Re: Contact Form

Thanks Rachael, i reckon your the most helpful person on this forum (no offense to any others that try!) and if your not already, ccp should be paying you a commission for clearly helping users get the most out of this tool, and in my case, purchase it in the first place after seeing some of your helpful threads/posts.

I'm going to search more of your threads now in cool mods, and see what else i can do hehe

Offline

 

#12 06-27-2006 12:42:21

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Contact Form

You're quite welcome.  I'm glad I could help.  Have fun!


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#13 08-27-2006 21:15:39

willp
Member
Registered: 07-14-2003
Posts: 48
Website

Re: Contact Form

rachaelseven,06/27/2006 07:39:43 AM wrote:

Sorry about that.  We need to make the phone number not a required field in ste_mail.pl - I forgot that I had done that some time in the past.  To do that, edit ste_mail.pl and find the line:

Code:

if ($fd_tracking_firstname eq "" || $fd_tracking_lastname eq "" || $fd_tracking_phone eq "" || $fd_tracking_email eq "" || $fd_message eq "") {

Change the above line to:

Code:

if ($fd_tracking_firstname eq "" || $fd_tracking_lastname eq "" || $fd_tracking_email eq "" || $fd_message eq "") {

Since you're sending all the mail to the site owner address, you don't need to do the rest of the mods in ste_mail.pl - this one should take care of it.  Sorry for the oversight.

Rachael

I made this change, removing the telephone number as a required field. CCP still will not accept the form unless I put something in there. I think I will just make the field hidden and put a dummy placeholder in as the default value.

Offline

 

#14 01-27-2007 16:39:56

SatOne.tv
Member
From: Cheshire | NW:UK
Registered: 06-30-2006
Posts: 161
Website

Re: Contact Form

Hi Rachael, i need your help!

I've been running the mod above for some time now, but just sending all emails for all departments to the same address. I now need the specific department emails to go to specific email addresses, but following the details above, it simply goes to the first from the list, no matter which i try. My code for that particular section in ste_mail.pl is:

#########
######### This routine sends contact messages.
#########

$fd_recipient = $q->param('recipient');

if ($fd_recipient = "General Enquiries") {
  $destination_email = "info\@satone.tv";
} elsif ($fd_recipient = "Existing Customer") {
  $destination_email = "info\@satone.tv";
} elsif ($fd_recipient = "Subscription Activation") {
  $destination_email = "support\@satone.tv";
} elsif ($fd_recipient = "Submit a Testimonial") {
  $destination_email = "testimonial\@satone.tv";
} else {
  $destination_email = $site_owner_email_address;
} ## end of if statement

$fd_message = $q->param('message');

$fd_recipient = $q->param('recipient');

$subject = "";

and further down:

######
###### Section Below Commented Out 8-15-06 RAK
######
##
## $dbins_mailelement_id = database_quote('mailelement','ste_mail_contact');
##
## $sql_statement = "
##
## SELECT mailelement_subject
## FROM mailelement
## WHERE mailelement_id=$dbins_mailelement_id
##
## ";
##
## my @mailelement = database_call('mailelement','SELECT',$sql_statement);
##
## foreach $row(@mailelement) {
##
## ($mailelement_subject) = @$row;
##
## $subject .= " - $mailelement_subject";
##
## } ######### End of foreach statement.
##
######
###### End Commented Out Section
######

######
###### Add Dropdown Value to Site Name to Get Subject
######

$subject .= " - $fd_recipient";

&vars_mailer($destination_email,$fd_tracking_email,$subject,$mail_display);

$fd_pg = "ste_contact_confirm";

} ######### End of if statement.

&initialize_sub_remove('ste_mail_contact_proc');

Plus within ste_contact.txt its:

<SELECT NAME="recipient">
<OPTION VALUE="General Enquiries">General Enquiries</OPTION>
<OPTION VALUE="Existing Customer">Existing Customer</OPTION>
<OPTION VALUE="Subscription Activation">Subscription Activation</OPTION>
<OPTION VALUE="Submit a Testimonial">Submit a Testimonial</OPTION>
</SELECT>

What am i doing wrong? I really need this setup working, but for some reason cannot get it to work right!

Thanks in advance

Last edited by SatOne.tv (01-27-2007 16:43:07)

Offline

 

#15 01-27-2007 19:48:55

csherwood123
Member
Registered: 10-22-2002
Posts: 235

Re: Contact Form

Change this:

$fd_recipient = $q->param('recipient');

if ($fd_recipient = "General Enquiries") {
  $destination_email = "info\@satone.tv";
} elsif ($fd_recipient = "Existing Customer") {
  $destination_email = "info\@satone.tv";
} elsif ($fd_recipient = "Subscription Activation") {
  $destination_email = "support\@satone.tv";
} elsif ($fd_recipient = "Submit a Testimonial") {
  $destination_email = "testimonial\@satone.tv";
} else {
  $destination_email = $site_owner_email_address;
} ## end of if statement

To This:

$fd_recipient = $q->param('recipient');

if ($fd_recipient == "General Enquiries") {
  $destination_email = "info\@satone.tv";
} elsif ($fd_recipient == "Existing Customer") {
  $destination_email = "info\@satone.tv";
} elsif ($fd_recipient == "Subscription Activation") {
  $destination_email = "support\@satone.tv";
} elsif ($fd_recipient == "Submit a Testimonial") {
  $destination_email = "testimonial\@satone.tv";
} else {
  $destination_email = $site_owner_email_address;
} ## end of if statement


And you should be good to go. (The existing code is using assignment operators even for it's comparisons - which of course always evaluate to true).

Offline

 

#16 01-27-2007 19:51:19

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Contact Form

Hi Ian,

I believe the problem is with the syntax of your if statement.  In PERL, a single = sign assigns a value, not compares it - seems to be ar error in my original post, sorry about that.  Try your if statement this way:

Code:

if ($fd_recipient eq "General Enquiries") {
  $destination_email = "info\@satone.tv";
} elsif ($fd_recipient eq "Existing Customer") {
  $destination_email = "info\@satone.tv";
} elsif ($fd_recipient eq "Subscription Activation") {
  $destination_email = "support\@satone.tv";
} elsif ($fd_recipient eq "Submit a Testimonial") {
  $destination_email = "testimonial\@satone.tv";
} else {
  $destination_email = $site_owner_email_address;
} ## end of if statement

I'm reasonably certain that will do the trick.  Sorry for the mistake.  Happy coding!

Rachael


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#17 01-27-2007 19:54:42

rachaelseven
Member
From: Massachusetts, USA
Registered: 01-23-2006
Posts: 3169
Website

Re: Contact Form

Jinx - posted at the same time!  == or eq will both work as a comparison operator instead of an assignment operator, so either of the solutions just posted will fix the problem.  I've corrected the original post so it won't lead anyone else astray.


Rachael Katz
- Custom Focusing Screens for DSLR Cameras

Offline

 

#18 01-27-2007 20:58:29

SatOne.tv
Member
From: Cheshire | NW:UK
Registered: 06-30-2006
Posts: 161
Website

Re: Contact Form

Thanks csherwood123 and rachael, that solved the problem, there's no way i was ever going to get that! smile
Have a 'virtual' drink on me!

Offline

 

#19 01-27-2007 21:24:11

celdirect
Member
From: UK
Registered: 04-01-2005
Posts: 782

Re: Contact Form

Ian,

Just went to your site to see the contact form

I think you need to make a white background default on your site - as i have mine in my browser, FireFox on blue.  so it looks bad on yours as my setting takes over.  I think!?!?

Offline

 

#20 01-27-2007 21:28:33

SatOne.tv
Member
From: Cheshire | NW:UK
Registered: 06-30-2006
Posts: 161
Website

Re: Contact Form

Not sure what you mean charlie, its just a very light grey background to the contacts page on my firefox?!?!

Offline

 

#21 01-27-2007 21:37:36

celdirect
Member
From: UK
Registered: 04-01-2005
Posts: 782

Re: Contact Form

Hi,

Not the form background - its the website main background - it looks like you dont have one set so a users browser setting will be used -

in FF go to tools>options >general> select fonts and colours > then change your background colour - you will see what i mean -

Sorry if  i am not explaining this right, i am a bit tired ( also could be barking up the wrong tree)

Last edited by celdirect (01-27-2007 21:40:05)

Offline

 

Board footer