can I use a .env var in the form recipient field? #10557
Replies: 2 comments 1 reply
-
Don't use the built in email stuff, handle it in your own listener. However it miiiight work with antlers in there, have you tried? |
Beta Was this translation helpful? Give feedback.
-
Follow Erin's advice here - best to do this in your own listener. Within the Form and email sending that Statamic does, submitted variables can be used in some config fields, but not things like the config helper in Antlers. Unless I'm missing something too, but we've tried similar things in the past and was just more reliable to have our own listener to handle custom logic. For example, we've used submitted variables to help tweak the subject for an email - that's able to be done via Antlers, such as Side note: just make sure you're using a registered config variable, not an env variable: when your config is cached, the |
Beta Was this translation helpful? Give feedback.
-
Just a basic Statamic contact form 👉 https://media.yep.digital/kJP4YG0m
I was wondering if I could change this depending on the environment. I've updated the mail config file so I can access the relevant environment variable, but I'm getting the impression this won't work the way I want.
Beta Was this translation helpful? Give feedback.
All reactions