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 344 posts 1170 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 1883 posts 6259 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 344 posts 1170 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 1883 posts 6259 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.

Please Sign in or register to post replies

Write your reply to:

Draft