Copied to clipboard

Flag this post as spam?

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


  • Adriano Fabri 469 posts 1633 karma points
    Oct 17, 2017 @ 09:57
    Adriano Fabri
    0

    How to configure a contact form to add a model field to the mail subject?

    Hi, how can I configure my contact form to to add the Current Page Node Name (or any other field) to the email subject on sending?

    Thank you

  • Nicholas Westby 2054 posts 7104 karma points c-trib
    Oct 24, 2017 @ 03:29
    Nicholas Westby
    0

    There is a form submitting event: https://github.com/rhythmagency/formulate/blob/96620f209c8e8132e2b6826e0c1d71080cb325b4/src/formulate.api/Submissions.cs#L52

    You can hook into that to dynamically change some of the data, such as the subject line of an email address.

    There is some info here about how to set the subject line dynamically ("Dynamic Email Parameters"): https://github.com/rhythmagency/formulate/releases/tag/v1.2.1

  • Adriano Fabri 469 posts 1633 karma points
    Nov 21, 2017 @ 11:12
    Adriano Fabri
    0

    But I cannot use a sintax like "[Model.Name]" o "[CurrentPage.Name]" directly in the subject field (in the handler) instead of hook the Submission methods?

  • Nicholas Westby 2054 posts 7104 karma points c-trib
    Nov 21, 2017 @ 17:34
    Nicholas Westby
    0

    But I cannot use a sintax like "[Model.Name]" o "[CurrentPage.Name]" directly in the subject field (in the handler)

    Not currently. That would be a good pull request if you would like to submit one.

    Also, you can create a custom handler if you like. Since it's open source, you can basically just copy the existing email handler and slightly modify it to support the syntax you're proposing for the subject line. This would have the advantage that you don't need to submit a pull request, which means you can just put together something quick and dirty without worrying about whether or not the pull request will be accepted.

  • Nicholas Westby 2054 posts 7104 karma points c-trib
    Jul 31, 2020 @ 18:32
    Nicholas Westby
    0

    FYI, the nicer syntax is now possible with Formulate Pro. See here for details: https://our.umbraco.com/packages/backoffice-extensions/formulate/formulate-questions/103084-customize-email-subject

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies