User Tools

Site Tools


phplugins_customize_the_thank_you_page

Customize the Thank You Page

This tutorial may be used to customize the content of the “Thank You” page after submitting the contact form. This will be most appropriate for users after upgrading to Form-to-Email Pro.

Using this technique to customize the Thank You page allows you to remove the “Form-To-Email by FormToEmail.com” message from the page.

The function uses the ttg_block_top hook to replace the block content only on the Thank You page, targeted by the G_STYLE identifier “CE3-PAGES-THANKYOU”.

The basic function looks like this:

// CUSTOMIZE THANK YOU PAGE CONTENT
function ttg_block_top( $style, $path ) { 
	if (G_STYLE == 'CE3-PAGES-THANKYOU') {
		echo '

		<div class="block-content grid_12 clearfix">
		<div class="typographic-content clearfix" style="text-align: center;">

		<!-- your content here -->

		</div>
		</div>
		';
		return false;
	}
	return true;
} // END

You may omit the style="text-align: center;" bit if you don't want the content to be centered.

Note that if you are already using the ttg_block_top elsewhere in your PHPlugins file, you will need to call it conditionally using else statements to avoid page-breaking script conflict. See the PHPlugins documentation for explanation.

You can add whatever you content you like. A filled out function might look like this, including a heading and paragraph:

// CUSTOMIZE THANK YOU PAGE CONTENT
function ttg_block_top( $style, $path ) { 
	if (G_STYLE == 'CE3-PAGES-THANKYOU') {
		echo '

		<div class="block-content grid_12 clearfix">
		<div class="typographic-content clearfix" style="text-align: center;">

		<h2>Thanks, dood!</h2>
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris blandit elit eget libero dapibus eu luctus ipsum cursus. Morbi vel tellus mollis mauris placerat molestie. Proin nec accumsan augue. Donec a metus in augue tempor rutrum. Mauris adipiscing est quis magna dapibus nec convallis ante varius. Suspendisse iaculis ultrices tortor eu condimentum. In erat nulla, ullamcorper ac tincidunt sit amet, elementum in odio. Vestibulum blandit tempor felis, ut pellentesque turpis facilisis ac. Donec quis feugiat felis. Nulla lobortis rutrum augue, vel pellentesque tortor condimentum sed. Nullam lobortis laoreet urna non mollis. Nullam vitae bibendum leo. Vestibulum mollis lacinia mauris eu dapibus. Nam ornare venenatis ullamcorper. Phasellus lacinia, quam in elementum euismod, mauris nunc imperdiet odio, vel mattis risus erat ornare mauris. Proin porttitor odio sit amet dolor lacinia et sollicitudin arcu luctus.</p>

		</div>
		</div>
		';
		return false;
	}
	return true;
} // END
phplugins_customize_the_thank_you_page.txt · Last modified: 2013/03/06 06:31 by admin