Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Matthew Kirschner 323 posts 611 karma points
    Jun 01, 2017 @ 21:22
    Matthew Kirschner

    Get form name in email template

    How do I get the form name in a custom, Umbraco Forms email template?

    My first thought was to use the GetField method of the FormsHtmlModel passed to the view, but I don't know what the key for form name would be. I've tried "formName" and "form_name" to no avail.

  • John Churchley 272 posts 1258 karma points c-trib
    Jul 16, 2017 @ 20:58
    John Churchley

    Did you work this out?

    I did it myself by creating a hidden field with default value but there must be a more elegant solution.

  • Matthew Kirschner 323 posts 611 karma points
    Jul 17, 2017 @ 13:28
    Matthew Kirschner

    Hi, John.

    I'm not using the Forms Email Templates until they add these features back in. It's like one step forward and two steps back with every new update.

    Instead, I've started using the PerplexMail package, which provides a Forms Workflow out of the box. I had to tweak a file to get the recordID and form name in the email template, but the package is open source so this was relatively easy. Let me know if you need help.

  • denisedelbando 141 posts 339 karma points
    Oct 02, 2017 @ 13:51

    did they get rid of it?

  • Chris Smith 38 posts 141 karma points
    Sep 05, 2019 @ 11:13
    Chris Smith

    Sorry for the bump, did this ever get resolved? I'm also trying to add the form name to the email template the customer will receive but without any luck.

    My last try was;




  • Jeremias 53 posts 278 karma points
    Nov 26, 2019 @ 08:49


    now I have a solution, that works for me:

        var uHelper = new UmbracoHelper(UmbracoContext.Current);
        Umbraco.Forms.Data.Storage.FormStorage formStorage = new Umbraco.Forms.Data.Storage.FormStorage();
        var formId = new Guid(uHelper.AssignedContentItem.GetPropertyValue<string>("form"));
        var form = formStorage.GetForm(formId);

    UmbracoAssignedContentItem is the page where you have picket the Form. So I get the guid from the form. With this the form and the Name of the form.

    I hope this helps you, too!

  • Matthew Kirschner 323 posts 611 karma points
    Nov 26, 2019 @ 15:57
    Matthew Kirschner

    Thanks for the work-around, Jeremias.

    Here's what I went with:

    @inherits UmbracoViewPage<Umbraco.Forms.Core.Models.FormsHtmlModel>
        // Get form name
        var formStorage = new Umbraco.Forms.Data.Storage.FormStorage();
        var form = formStorage.GetForm(Model.FormId);
        var formName = form.Name;
  • Diedrik Kuypers 3 posts 73 karma points
    Feb 11, 2020 @ 08:55
    Diedrik Kuypers


    I'm trying to reuse a single template for multiple forms, and would like to get the form name into the email template. When I try your example code, I get the following error.

    The type or namespace name 'FormStorage' does not exist in the namespace 'Umbraco.Forms.Data.Storage'``

    How do we access the FormStorage in the latest Umbraco Forms version?

  • Chris Speakman 15 posts 129 karma points
    May 21, 2020 @ 11:42
    Chris Speakman

    Did you ever find an answer to this Diedrik?

    I'm trying to do exactly the same as you with a re-usable template but FormStorage appears to be an internal class now.

    Is there an alternative way of getting the form name?

  • Frans de Jong 541 posts 1788 karma points MVP 3x c-trib
    Feb 11, 2020 @ 09:53
    Frans de Jong

    There is more information about how to get this info here:

    If you need more information in the template you need to add a new feature request. there

Please Sign in or register to post replies

Write your reply to: