Published on

EmailTextField for Authenticated users

Authors

One of the best parts of the Sitefinity12.1 release for us was the addition of custom email responses. So in a form that contains the Email field, someone can get a custom email sent back to them!  This is especially helpful if your form submission redirects to some landing page instead of a message.

Problem though on an Intranet is using this new EmailTextField is redundant. It’s an input[type=text] with a ton of validation and stuff, but we KNOW who the user is.

So the modification below checks to see if the user is authenticated, if they are, it’s just a hidden field and no extra bloat.  You could though keep this file the same and just name a NEW template like Write.Authenticated.cshtml and pick that in the form control designer.

This is my modification to the default template.

Installation

Add this to ~/Mvc/Views/EmailTextField/Write.Default.cshtml

Boost your online presence.

Let us create the perfect digital experience for your company.

Contact us now