Auto Email Response from form Submission

July 29th, 2010

Here is how you set up a form submission to automatically send a custom email back to the person who filled out the form. I am using this feature for a client who wants to distribute a PDF automatically to the user but wants to know who is downloading it. As opposed to just posting a link to download the PDF on their site I have created a form that the user must first fill out to get the PDF. Here is what you need to do to set something like this up for yourself:

1. Create a simple form in Facile Forms. It can ask for anything, but it needs to have a field for the user to input their email (or else the auto respond email will have no where to go!)

2. Once your form is complete, click on the “Manage Forms” button on the upper right hand of your screen. This will bring up a list of all your forms created within Facile Forms.

3. Click on the name of your form. (important: not the title, but the name)

4. Click on the tab “Submit Pieces”

5. Select the “Custom” radio button under the “Begin Submit” section and paste the following code into the box that appears:

// load the standard FacileForms library
$this->execPieceByName(‘ff_InitLib’);

//Sends confirmation e-mail to the visitor


$from = ff_getSubmit(‘cf_name’);
$this->sendMail(
$mosConfig_mailfrom,                // email from name: as in config.php
$mosConfig_fromname,                // email from addres: as in config.php
ff_getSubmit(‘cf_email’),           // email address as filled in by visitor
‘Put Subject of Email Here’,
‘Dear ‘.$from.’,’.nl().nl(). ‘This is where you put your custom message’.nl().nl().
‘This is the last line of your custom message.’
);

6. Click Save & Test your form!

A few notes:

  • The code for the script is really finicky. If you put one wrong period or space in there and it will throw a [Parse error: Syntax error, Unexpected T_String...] so be careful. I found it best to copy and paste the code into a text edit document and make my changes there, then copy and paste into the site when you are ready. This will help you keep track of what you have done & when in doubt return to my code provided if you mess up.
  • The  string [.nl().] found throughout the code are what create new lines. Put more of them together to create more space, use just one if you want a single line break.
  • Be sure that the last line of your message ends with a ‘ and the whole code block ends with a );
  • The ['Dear '.$from.','.nl().nl().] code string is what addresses the email. If you did not ask for the users name, this feature will not work.
  • The variables used throughout (ie: cf_name) are based on what FacileForms auto generates for the name and email field titles. If you have changed yours to something custom, then you’ll need to update this code accordingly.

FacileForms Troubleshooting

March 19th, 2010

So far the best third party form generator I have come across for Mambo is one called FacileForms. It takes a bit to learn how to incorporate them, but once you do, they are pretty useful. When you go to the site, download an install the Mambot, Component and the Module. You use the universal installer to upload them.

Once installed, you should check out the getting-started documents found on their site. They will help you learn the basics.

Troubleshooting

If the info input into the fields of your form are not being recorded you need to make sure the form element (ie: textarea) is above its label (ie: static text/html). Not above it in the graphic sense (how it is viewed on the front end) but rather in the backend of the facile form manager where they list each individual form element.

If the form is not submitting make sure all the form elements are lower case and are different from each other. (ie: cannot have the label and form element share the same name)

Hosting

March 17th, 2010

Not sure which hosting proivder to go with? I ALWAYS use GoDaddy. They are amazing. They will install mambo for you (for free) in their “GoDaddy Hositing Connection” section in your account. All you did is click the install Mambo button, answer a few questions and say GO, then they do the rest. Its genious.  Their customer support is the best. They are always there to pick up the phone and answer your questions (no matter how stupid of the question). They are competitively priced and in my opinion could charge more then they do, and I would still stay with them. I have owned my business for over 6 years and I have used them the whole way.

Mambo Manual Install- Session Save Path unwritable?

March 17th, 2010

If  have to do a manual install of mambo on your server you will find the Mambo Manual to be very helpful. It basically holds your hand through the whole process. I just finished an install and it took be about 1 hour to go through it all. If you host with GoDaddy, they will install if for you through their “Godaddy Hosting Connection” section of your account. This reason alone is why I always use GoDaddy for my client’s hosting provider (when I get the choice). Sometimes I am forced to work with pre-existing hosting accounts, and in those times does the Mambo Manual come in handy.

On step of the process is doing a pre-install server check to make sure you have all the correct settings. If anything is not right it will appear in red. A common problem with the pre-install is the “Session Save Path” being unwriteable. To change this you will need to gain access to the php.ini file that should be found in the control panel of your site. In most cases the session save path is already in the php.ini file you just need to un-comment it out. (ie: go from “; session.save_path = /tmp” to “session.save_path = /var/tmp”). To un-comment it out, remove the semi-colon found at the beginning of that line, I have made it red here so you can see is clearly.

If you do not have that line in your php.ini file OR you see it and it already is un-commented out, then you will need to call your hosting provider. No matter what the hosting company’s technical support tell you, this is a problem that they have to fix. I have run into a few hosting providers that just don’t know how to help you, and so they say they cannot do that. In fact, they are the ONLY ones who can do it. Ask for their supervisor or technical support manager. Its actually a simple fix for them, its just a permission issue on the session save path directory.

SEO- Page Titles in Mambo

March 9th, 2010

One of my areas of expertise for website production is Search Engine Optimization. A big player in your SEO rating is your page titles. Fortunately mambo has a dynamic page title feature that allows you have to specific titles for each page. To enable this go to: Site>Global Configuration, then click on the SEO tab and hit the radio button next to Dynamic Page title to yes. Its important to note that the dynamic page titles are take from the content titles.

I noticed that Mambo automatically adds the URL into the dynamic page titles, which may or may not be what you want. Since every word in the page title is weighted for SEO (the more words you have the less importance each word has), I wanted to remove it. To do that you need to remove the “Site Name” in the Global Configuration. When I removed it it didn’t remove it right away, so I had to go into the configuration.php file found at your site root and remote is there as well in the “$mosConfig_sitename = ”;” section.

And ther you go, custom dynamic page titles without the URL!

Stop code from being added/taken away where you don’t want it

February 16th, 2010

By default the Mambo editor MOStlyCE has a ‘code cleanup’ feature on.  Under normal circumstances this is fine, but sometimes you need to add special code in that the Code Clean up does not allow (ie: form code). To turn the ‘code cleanup’ off, follow these steps:

  1. Find the file “mostlyce.php” on your sever and edit it in a text edit program, the path to find this file on your sever is: /mambots/editors/mostlyce.php (I would save a back up somewhere, in case you mess up)
  2. Once the file is open, do a find for the following snipit “tinyMCE.init”, once you find it, place this code somewhere within the brackets: cleanup : “false”,
  3. Save this file, and upload to the same place you found it.
  4. Login and logout of your admin panel and your done

My Mambo Solutions Revealed

February 16th, 2010

I own a small graphic design company based out of Northern California. My company does pretty much everything under the “Graphic Design” umbrella with a specialization in website design. The last few years I have noticed a growing trend in clients needing to be able to update their sites on their own. After much research I settled on using the Content Management System called Mambo to be my platform of choice. Since then, about 99% of my clients opt for the CMS based site (as opposed to the traditional HTML). Over the years I have mastered the art of harnessing the Mambo beast.

What follows is a compiliation of all my tips, tricks and solutions I have found over the years. Because Mambo is open source there is no one authority to tell you what to do when something goes wrong. As a result when something does go wrong, you are left hunting and pecking around forums to find your solution. I am by no means a expert when it comes to Mambo, but I have learned a few things over the years that might be able to help some of you out. Feel free to comment if you have any knowledge to add.