• Resolved FlourishDNA

    (@flourishdna)


    Hello, I have created custom email placeholders for custom fields but I am having an issue with the multi-select fields as they are showing array text in the email instead of showing the multiple values submitted.

    The business_locations field has location names where users can select multiple locations during sign-up. Below is how I have set up email placeholders.

    add_filter( 'um_template_tags_replaces_hook', 'my_template_tags_replaces', 10, 1 );
    function my_template_tags_replaces( $replace_placeholders ) {
    	$replace_placeholders[] = um_user('business_locations');
    	return $replace_placeholders;
    }
    
    add_filter( 'um_template_tags_patterns_hook', 'my_template_tags_patterns', 10, 1 );
    function my_template_tags_patterns( $placeholders ) {
    	$placeholders[] = '{business_locations}';
    	return $placeholders;
    }

    I have used below shortcode in the email template.
    Business Locations: {business_locations}

    This is how it comes in the email:
    Business Locations: Array

    I would be very thankful if somebody could help me out.

    • This topic was modified 5 years, 5 months ago by FlourishDNA.
    • This topic was modified 5 years, 5 months ago by FlourishDNA.
    • This topic was modified 5 years, 5 months ago by FlourishDNA.
Viewing 1 replies (of 1 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi,

    Sorry for the delay on responding to your ticket.

    Could you please try the following code snippet?

    
    add_filter( 'um_template_tags_replaces_hook', 'my_template_tags_replaces', 10, 1 );
    function my_template_tags_replaces( $replace_placeholders ) {
            $arr_business_loc = um_user('business_locations');
    	$replace_placeholders[] = $arr_business_loc[0];
    	return $replace_placeholders;
    }
    
    add_filter( 'um_template_tags_patterns_hook', 'my_template_tags_patterns', 10, 1 );
    function my_template_tags_patterns( $placeholders ) {
    	$placeholders[] = '{business_locations}';
    	return $placeholders;
    }
    

    Hope this helps you.

    Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Multi-select value showing as array text in the email.’ is closed to new replies.