Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: Ability to get other values from the formset #1

Open
gmcz opened this issue Jan 8, 2019 · 1 comment
Open

FR: Ability to get other values from the formset #1

gmcz opened this issue Jan 8, 2019 · 1 comment

Comments

@gmcz
Copy link

gmcz commented Jan 8, 2019

I have several other key/value pairs in my formsets beyond the standard, for example:

title: An Awesome Form
fields:
  cool_thing:
    display: 'What is a Cool Thing?'
    detail: 'Please tell us what a Cool Thing is so we can know your answer.'
    type: textarea

I would really like to be able to include this in the automagic email templates as well! If I'm happy to work on this and submit a PR but I'd need a bit of direction to get going.

@aryehraber
Copy link
Contributor

Hey @gmcz!

I actually wanted the exact same feature while building this, but (if memory serves) it wasn't possible because inside the email template's context there's no way to see what formset it originated from -- you only receive the submission data itself.

I believe this was also the reason that I had to resort to titleizing the keys instead of grabbing the actual titles from the formset.

Might be worthwhile to submit a FR to Statamic to get the formset name in the context, then it can be added here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants