RensTillmann / super-forms

18 stars 14 forks source link

Conditional or optional email logic (selectable recipients ) #18

Closed jrameriz closed 3 years ago

jrameriz commented 4 years ago

Is there a way to have optional emails using conditional logic. I've created a variable field to send to specific name = name@domain.com or name2 - name2@domain.com for confirmation email. this works but this is not best practice because when using variables the emails are displayed in source code. Is there a way to hide the email from displaying? Am i missing something?

in the past i was using pipes to show a name instead of the email: https://contactform7.com/selectable-recipient-with-pipes/

RensTillmann commented 4 years ago

No, the only way to prevent is currently is having the email hardcoded into the setting of your form, and not using {tags} to retrieve it. Another way is to use hooks to filter the submission data and alter it in such way that it appends the email address that you wish to send the email to. We have thoughts about adding some sort of "Server side variables" feature into super forms but haven't had the time for this yet.

If you have other suggestions feel free to share them here. Thanks.

jrameriz commented 4 years ago

hmmm.... wondering how pipes works maybe replacing before submission. for the time being I will use variables, later maybe look into what CF7 is similarly working with pipes and creating a hook for it. Thank you for your fast response. If i do work on this hook i will share what i have.

RensTillmann commented 4 years ago

Yes before the form submits, they grab it from the database based on selected value. But we can't compare Super Forms with CF7, because CF7 is very basic and not that flexible. The only thing you can do right now is to use filters and do it manually. Will implement something in the future that allows to map things like these so it's only stored server side and never visible on the client (source code).

jrameriz commented 4 years ago

Thank you! I look forward to the implementation of this process!!!

RensTillmann commented 3 years ago

Hi, the latest version contains a new feature called Secrets. You can read about it here: Secrets.

It should help you with doing what you needed to do (retrieving E-mail address on the server side savely without exposing it in the source code).