• Hello,
    Thanks a lot for such a great plugin. The screenshots attached to the plugin says you can add your own custom variables to the message aside the available variables. I’d like to know how to do that. I’d like to make my messages more personalized by saying something like Hey {first_name}, your order with ID {order_id} has been received.

    Also are there woocommerce variables that you can just use by default?

Viewing 1 replies (of 1 total)
  • Plugin Author PieterC

    (@siteoptimo)

    Hey Isaac,

    This is the code related to custom variables:

    
        public static function getVariables() {
            return apply_filters( 'wcp_variables', array(
                'order_id'  => __( 'The ID of the order.', 'woocommerce-plivo' ),
                'home_url'  => __( 'The home URL.', 'woocommerce-plivo' ),
                'shop_name' => __( 'The name of the shop.', 'woocommerce-plivo' ),
            ) );
        }
    
        public static function getVariableValues( $order_id ) {
            return apply_filters( 'wcp_variable_values', array(
                'order_id'  => $order_id,
                'home_url'  => home_url(),
                'shop_name' => get_option( 'blogname' ),
            ), $order_id );
        }
    

    So you’ll want to use those two filters to add custom variables.

    Best regards,

    Koen

Viewing 1 replies (of 1 total)
  • The topic ‘How to add new custom variables to SMS message’ is closed to new replies.