ContactUs Control (7.0.8 Gold)

This forum is where we'll mirror posts that are of value to the community so they may be more easily found.
Post Reply
User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

ContactUs Control (7.0.8 Gold)

Post by mazhar » Thu Jan 17, 2013 10:46 am

This is a simple sample that how to write a Feedback or contact control for AbleCommerce using the AbleCommerce configured SMTP settings. Please download the attachment for the source code of the control. The control exposes a single property SendTo that is used to specify the Email address where you want to receive the Emails sent by the control. You can use it like any other control

Code: Select all

[[ConLib:ContactUs SendTo="info@yourstore.com"]]
Note: If you don't configured this SendTo property the Email will be sent to your default Email address which you configured for the store in the SMTP settings.

There are two version of control one for Web Application project and one for website project. In order to install the control select the zip version that is compatiable to your ablecommerce build type, extract the files and place them in Website/ConLib folder. Now if you are using Website project you are done and you can use the control as mentioned above. If you are using Web Application project then you need to use Visual Studio and include the control files in project and build the project. Once build is complete you will be able to use the control as mentiond above.

[SCREEN SHOT]
Attachments
ContactUs.jpg
(16.25 KiB) Downloaded 11476 times
ContactUs(Web Application).zip
(2.07 KiB) Downloaded 303 times
ContactUs(Website Project).zip
(1.46 KiB) Downloaded 320 times

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ContactUs Control (7.0.8 Gold) With Captcha

Post by mazhar » Mon Jan 21, 2013 5:22 am

This is an update to existing contact us control. In order to avoid spams we can extend the contact us control to support the captcha code. I have used the captcha available with AbleCommerce. In order to install the control just extract the control files and place them in the ConLib. The control Supports an EnableCaptcha property which you can set to True/False to enable or disable captcha. By default the captcha is enabled. You can change the mail subject by using Subject property. You can set SendTo property to specify the Email address where you want to receive the messages. If you don't specify this property the Email will be sent to store's default Email address. For example you can place the control in some store page as bellow

Code: Select all

[[ConLib:ContactUs SendTo="info@mystore.com" ]]
There are two version of control one for Web Application project and one for website project. In order to install the control select the zip version that is compatiable to your ablecommerce build type, extract the files and place them in Website/ConLib folder. Now if you are using Website project you are done and you can use the control as mentioned above. If you are using Web Application project then you need to use Visual Studio and include the control files in project and build the project. Once build is complete you will be able to use the control as mentiond above.
Attachments
contactus.jpg
(42.01 KiB) Downloaded 11452 times
ContactUs (Web Application).zip
(3.41 KiB) Downloaded 290 times
ContactUs(Website Project).zip
(2.62 KiB) Downloaded 304 times

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ContactUs Control (7.0.8 Gold) With Captcha, Attachment

Post by mazhar » Mon Jan 21, 2013 5:46 am

You can easily incorporate the attachment ability in the contactus control. Here is the modified version of the ContactUs control with attachment support
Attachments
contactus-attachment.gif
(6.81 KiB) Downloaded 11452 times
ContactUs(Web Application).zip
(3.58 KiB) Downloaded 276 times
ContactUs(Website Project).zip
(2.77 KiB) Downloaded 325 times

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ContactUs Control (7.0.8 Gold) With Send To List

Post by mazhar » Mon Jan 21, 2013 5:55 am

Here is the next version of ContactUs control. This version provides support to show a list of send to emails, so that when placing a comment customer can select among different destinations. Also now after posting the comment the control will hide the Email form and will only show the message.
The control exposes a SendToList property. You can provide a display text and Email value for an Email address by separating these both with : character. Multiple emails will be separated by | sign. Check the following example usage. Please check the screen capture for output.

Code: Select all

[[ConLib:ContactUs EnableCaptcha="false" SendToList="Information:info@yourstore.com|Sales:sales@yourstore.com|jobs:jobs@yourdomain.com"]]
Attachments
contactus-sendtolist.JPG
(13.18 KiB) Downloaded 11452 times
ContactUs(Web Application).zip
(3.7 KiB) Downloaded 326 times
ContactUs(Website Project).zip
(2.86 KiB) Downloaded 297 times

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5168
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: ContactUs Control (7.0.8 Gold)

Post by AbleMods » Fri Jan 24, 2014 6:22 am

Very useful Mazhar, thank you.

Able should make this control a part of the default Gold install and the default ContactUs page.

I've yet to do a store setup for a client that didn't want some sort of email page like this.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5168
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: ContactUs Control (7.0.8 Gold)

Post by AbleMods » Fri Jan 24, 2014 6:48 am

Although it might be better to throw exceptions when the SMTP response isn't a success, just like the test email settings page does in the admin side.

This will make the shopper aware that the email could not be sent for some SMTP-related reason such as grey-listing being enabled on the recipient mail server.

change this line:

Code: Select all

EmailClient.Send(mailMessage);
to look like this:

Code: Select all

EmailClient.Send(mailMessage, smtpSettings, true);
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

ChipWV
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 87
Joined: Tue Feb 03, 2009 12:51 pm

Re: ContactUs Control (7.0.8 Gold)

Post by ChipWV » Fri Feb 20, 2015 1:17 pm

Hi Mazhar,

I currently have your great updated ContactUS control installed on a regular AC Webpage which works great on a PC, however I've not been able to figure out how to get the ContactUS control to display in a mobile friendly way. It does render and function, but in a tiny, squished, desktop mode. I'm thinking a mobile friendly version of the regular AC Webpage may be necessary, which would be a good for other uses too.

Thanks!
Chip

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ContactUs Control (7.0.8 Gold)

Post by mazhar » Sun Feb 22, 2015 11:54 pm

ChipWV wrote:Hi Mazhar,

I currently have your great updated ContactUS control installed on a regular AC Webpage which works great on a PC, however I've not been able to figure out how to get the ContactUS control to display in a mobile friendly way. It does render and function, but in a tiny, squished, desktop mode. I'm thinking a mobile friendly version of the regular AC Webpage may be necessary, which would be a good for other uses too.

Thanks!
Chip
Maybe a media query should do the trick. You can try adding following CSS

Code: Select all

@media screen and (max-width: 480px) {
  table.inputForm th,
  table.inputForm td,
  table.inputForm .rowHeader {
    position: relative;
    float: left;
    clear: both;
    width: 100%;
    text-align: left;
  }
  table.inputForm th,
  table.inputForm .rowHeader {
    padding: 5px 0 5px 0;
  }
  div.inputForm div.rowHeader {
    text-align: left;
  }
}
This should collapse the control on smaller devices by horizontally stacking captions and input boxes over each other. In order to minimize the scope of this change you may need to wrap the control content in some div and give it some suitable css class. Finally update above css to limited only for inputForm under that new div using multiple class names.

User avatar
efficiondave
Commander (CMDR)
Commander (CMDR)
Posts: 151
Joined: Tue Dec 02, 2008 10:20 am
Location: St. Louis Missouri
Contact:

Re: ContactUs Control (7.0.8 Gold)

Post by efficiondave » Tue Apr 07, 2015 1:53 pm

You should update the wiki page on this with the new code:
http://wiki.ablecommerce.com/index.php/ ... Us_Control

I wasted time updating the old code from the wiki prior to finding this.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5082
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: ContactUs Control (7.0.8 Gold)

Post by mazhar » Wed Apr 08, 2015 1:33 am

Sorry to know that david. I just updated the WIKI article with download information about the ported version.

User avatar
efficiondave
Commander (CMDR)
Commander (CMDR)
Posts: 151
Joined: Tue Dec 02, 2008 10:20 am
Location: St. Louis Missouri
Contact:

Re: ContactUs Control (7.0.8 Gold)

Post by efficiondave » Wed Apr 08, 2015 7:23 am

you should really use a HoneyPot field instead of CAPTCHA. Much more user friendly and more effective for now.
https://www.dexmedia.com/blog/honeypot-technique/

Post Reply