Page 1 of 1

ContactUs Control (7.0.8 Gold)

Posted: Thu Jan 17, 2013 10:46 am
by mazhar
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]

Re: ContactUs Control (7.0.8 Gold) With Captcha

Posted: Mon Jan 21, 2013 5:22 am
by mazhar
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.

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

Posted: Mon Jan 21, 2013 5:46 am
by mazhar
You can easily incorporate the attachment ability in the contactus control. Here is the modified version of the ContactUs control with attachment support

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

Posted: Mon Jan 21, 2013 5:55 am
by mazhar
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"]]

Re: ContactUs Control (7.0.8 Gold)

Posted: Fri Jan 24, 2014 6:22 am
by AbleMods
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.

Re: ContactUs Control (7.0.8 Gold)

Posted: Fri Jan 24, 2014 6:48 am
by AbleMods
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);

Re: ContactUs Control (7.0.8 Gold)

Posted: Fri Feb 20, 2015 1:17 pm
by ChipWV
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

Re: ContactUs Control (7.0.8 Gold)

Posted: Sun Feb 22, 2015 11:54 pm
by mazhar
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.

Re: ContactUs Control (7.0.8 Gold)

Posted: Tue Apr 07, 2015 1:53 pm
by efficiondave
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.

Re: ContactUs Control (7.0.8 Gold)

Posted: Wed Apr 08, 2015 1:33 am
by mazhar
Sorry to know that david. I just updated the WIKI article with download information about the ported version.

Re: ContactUs Control (7.0.8 Gold)

Posted: Wed Apr 08, 2015 7:23 am
by efficiondave
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/