Jump to content

Customize pre-sale contact form mail contents


sujithm

Recommended Posts

Hello

 

I would like to customize email messages sent while submitting pre-sales contact form. Now in the email, only the message part entered by the visitors is shown. I would like to add the name & email fields also as a part of the mail message sent.

 

Where/How could I edit this?

 

Thanks & Regards

Sujith

Link to comment
Share on other sites

Hi Sujith,

 

I don't think that you can edit it - it doesn't use an email template and is hard-coded... perhaps it can be tweaked with an action hook, but i'm not sure.

 

the alternative would be to use a support department instead - that might allow you the flexibility to modify the template output to your needs.

 

http://docs.whmcs.com/Mail_Tab#Presales_Form_Destination_OR_Presales_Contact_Form_Email

Link to comment
Share on other sites

  • 3 weeks later...
Hi Sujith,

 

I don't think that you can edit it - it doesn't use an email template and is hard-coded... perhaps it can be tweaked with an action hook, but i'm not sure.

 

the alternative would be to use a support department instead - that might allow you the flexibility to modify the template output to your needs.

 

http://docs.whmcs.com/Mail_Tab#Presales_Form_Destination_OR_Presales_Contact_Form_Email

 

Hi Briani

 

Thanks for your response. If we use support department, all requests coming through contact form will be considered as tickets. Right?

 

In my case, the details sent as email from contact form is perfectly alright. What I need is to add a new field in the contact form for telephone and when we receive email, it should contain the telephone number of the person who submitted contact form.

 

Let me look for the option with hooks. I haven't ever worked with hooks, but I think this will be the best option (if it works).

 

Thanks & Regards

Sujith

Link to comment
Share on other sites

One option is to add your own contact form to replace the WHMCS one, you could do this by editing your template's contact.tpl file.

 

If you use a service such as Jot Form it'll be easy to build your own contact form.

Jack, worryingly I had the same thought this morning - great minds think alike... though perhaps i'm more old-school as I was thinking of a php formmail script. :)

 

but as you say, the form is editable in contact.tpl - so it should just be a case of adding the new field and changing the post from contact.php to either a local or third-party hosted script... that should also allow you to modify the output to the emails too.

Link to comment
Share on other sites

Jack, worryingly I had the same thought this morning - great minds think alike... though perhaps i'm more old-school as I was thinking of a php formmail script. :)

 

Indeed my friend :) One of my customer's asked me this same question a couple of days ago as they wanted to add a phone number field to the contact form.

 

If it were me I'd also prefer to use a PHP form (I'd create a seperate page and drop the WHMCS contact.php page) but seeing as the PHP has to be separated from the form markup a form builder would be easier seeing as it's usually a case of adding some Javascript to the .tpl file.

 

You do fantastic work on this forum Brian. It's funny because I see a new thread where I think I can add value and get a little excited, as soon as I click on it I generally see that you've already replied in detail and sorted the problem :D

Link to comment
Share on other sites

Hello,

 

One option is to add your own contact form to replace the WHMCS one, you could do this by editing your template's contact.tpl file.

 

If you use a service such as Jot Form it'll be easy to build your own contact form.

 

Jack

 

Hi Jack

 

Thanks for your input. I tried to add a new field to contact.tpl, but it is not showing up anywhere in the email received. So I presume that I have to create a new PHP file to which the contact form will be submitted. And in this new PHP file, should accept parameters sent from contact.tpl and send emails using PHP functions. I am trying that option, but due to some other urgent tasks, I have postponed my plans to fix contact form. Will try these possibilities and shall update this thread if my customization work well.

 

Thanks & Regards

Sujith

Link to comment
Share on other sites

Hi Jack

 

Thanks for your input. I tried to add a new field to contact.tpl, but it is not showing up anywhere in the email received. So I presume that I have to create a new PHP file to which the contact form will be submitted. And in this new PHP file, should accept parameters sent from contact.tpl and send emails using PHP functions. I am trying that option, but due to some other urgent tasks, I have postponed my plans to fix contact form. Will try these possibilities and shall update this thread if my customization work well.

 

Thanks & Regards

Sujith

 

Yes correct it won't work as you also would have to set it up in contact.php which is encoded so can't be edited.

 

It's best to create a new page e.g contactus.php and use a custom PHP form.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated