Copied to clipboard

Flag this post as spam?

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


  • mizzle 90 posts 325 karma points
    Jul 18, 2019 @ 17:48
    mizzle
    0

    Getting form settings from a page's Nested Content property fields.

    Although I have an alternative solution if it turns out to be impossible, I was wondering if there was any way to pull field values from a nested content property on a page into the settings of a contact form? I wanted to try and keep everything on the site super simplified.

    For example, if I wanted to use the Contact Form doctype with the property "subject" within the Nested Content section of a page to customize the subject line of an email sent via the form Controller, could it be done?

  • Jonathan Distenfeld 105 posts 618 karma points
    Jul 23, 2019 @ 09:25
    Jonathan Distenfeld
    0

    Hi Mizzle,

    are you using Umbraco Forms for your contact form? If this is the case i would recommend this package in order to change settings for your form: https://our.umbraco.com/packages/backoffice-extensions/perplexmail-for-umbraco/.

    Otherwise if you have your own custom code for the form, you could try and get the Content Node with the settings you want to use from within your Contact Form Controller Action and use the field values to send your email. Or if you already have the correct Node within your View, you could simply pass the settings to your action.

    If you are still running into problems with one of these suggestions, keep us updated here. I would be glad to help.

    ~ Jonathan

  • mizzle 90 posts 325 karma points
    Jul 23, 2019 @ 13:43
    mizzle
    0

    Hi Jonathan, thanks for your reply.

    I'm using my own code for the forms. I have the code in the controller set to pull from the current page node successfully (in previous projects, I've just built a Contact Page doctype that had a Form Info tab; I wanted to see if I could make a form into a Nested Content item that could be added to any page instead, with the added bonus that I would be able to move the form around amongst other Nested Content items).

    I've also been able to target Form info doctypes set in separate "Site Settings" nodes with a content picker Nested Content item, which I think is an okay alternative. But for ease of use on editors, I really wanted to contain everything within one section of a page, down to the form settings/information. I just haven't been able to successfully target the Nested Content values from either my Controller or my View, for one reason or another.

Please Sign in or register to post replies

Write your reply to:

Draft