• Resolved kevinpinkster

    (@kevinpinkster)


    Hi,

    I am looking for a way to show filled in repeater field forms in a table wich is send by email.

    As example:
    Product | Price per piece | Amount
    Product 1 | 1,55 | 2
    Product 2 | 2,65 | 3
    etc.

    ‘|’ represents table cell divider

    Hope someone knows a way to get this done.
    Thanks in advance!

Viewing 1 replies (of 1 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback!

    In order to fully customize the HTML of your Email Action, I would recommend to use the acfe/form/submit/email_args filter (See documentation).

    It will let you retrieve any field value using get_field() and construct your HTML freely.

    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){
        
        // retrive my field
        $my_field = get_field('my_field');
        
        // start HTML buffer
        ob_start();
        ?>
        
        <p>Hello</p>
        
        <p>This is a custom HTML email</p>
        
        <table>
            <tr>
                <td><?php echo $my_field; ?></td>
            </tr>
        </table>
        
        <p>Regards</p>
        
        <?php
        
        // retrieve HTML buffer
        $html = ob_get_clean();
        
        // inject html in the email content
        $args['content'] = $html;
        
        // return
        return $args;
        
    }
    

    Of course, you can also use have_rows(): the_row(); get_sub_field('my_sub_field'); if you have a repeater etc…

    Hope it helps!

    Have a nice day!

    Regards.

Viewing 1 replies (of 1 total)
  • The topic ‘Table in e-mail acfe-form fields’ is closed to new replies.