• Resolved monagraphic

    (@monagraphic)


    Hello,

    I created a form with ACF Extended from fields groups.
    In my fields, i have a “select” with “value:label” like :

    [email protected]: Support
    [email protected]: Manager
    etc..

    In my email action, i would like to add inside “To” field, my “value” (not the label) to send email to specific recipient.

    Any one have idea ?

    Thanks.

    • This topic was modified 2 years, 4 months ago by monagraphic.
    • This topic was modified 2 years, 4 months ago by monagraphic.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    Unfortunately you can’t do that from the UI, since Template Tags are programmed to display “readable” values (ie: the label). In order to use the select value, you’ll have to use the acfe/form/submit/email_args (See documentation) in order to force the value of your choice.

    Usage example:

    add_filter('acfe/form/submit/email_args/form=my-form', 'my_form_email_args', 10, 3);
    function my_form_email_args($args, $form, $action){
        
        // retrieve my_select value
        $my_select = get_field('my_select');
        
        // set the value as destination
        $args['to'] = $my_select;
        
        // return
        return $args;
        
    }
    

    Hope it helps!

    Have a nice day!

    Regards.

    Thread Starter monagraphic

    (@monagraphic)

    Hello Konrad,
    It works, thanks a lot ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ACF Forms’ is closed to new replies.