6 YEARS AGO

Creating a custom newsletter subscription form

Let's say you want to add an additional field to the newsletter subscription form. In previous versions of Kentico you would have to create a copy of the web part and add the fields manually in the code. With version 7 this is no longer needed. Using the new "Custom subscription form" web part, you can specify the alternative form that should be used. In this post I will demonstrate how easy it is to add an additional company field to the newsletter subscription form.

Let's say you want to add an additional field to the newsletter subscription form. In previous versions of Kentico you would have to create a copy of the web part and add the fields manually in the code. With version 7 this is no longer needed. Using the new "Custom subscription form" web part, you can specify the alternative form that should be used. In this post I will demonstrate how easy it is to add an additional company field to the newsletter subscription form.


Step 1: Create the company field

Go to "Site Manager" --> Development --> "System tables" and edit the "Newsletter - Subscriber" table. Add a new field called "SubscriberCompany" with the following values:

Add the company field


Step 2: Create the alternative form

Open the "Alternative forms" tab and create a new alternative form called "My custom subscription form". Tweak the form as you please. I added some watermarks and created a custom layout where I removed the labels.

Tweak the form


Step 3: Add and config the web part

Find the page to place the newsletter subscription form and add the "Custom subscription form" web part. Config the web part and make sure to select the "Alternative form" that we created in step 2.

Update the web part properties


Step 4: View the result


Custom newsletter subscription form

Special thanks go out to Zdenek and his team for adding this feature :)