• Damn, it has been updated after a long time. Could you please also add info about payment method option which was used to complete transaction? And could you also allow us to select what informations we want to send via webhook? For example not everyone might want to sent webhooks with information such as email and name, surname. I think it would be also cool to add option to customize how webhook look (colors, fonts and so on) and which info is shown first from top to the bottom, for example email first instead of order number…

    Thanks in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jarryd Long

    (@jarryd-long)

    Hi @xdekhckr ,

    Thank you for sharing a 5 star review for the plugin. You’ve made my day.

    You can hook into a filter that removes the name and email address as well as changes colours. Here’s a starter code snippet that will help achieve this – this can be added to your theme’s functions.php file.

    If you have any other questions about this, please consider opening a support thread on this plugin’s forum and we can assist further from there.

    add_filter( 'ppsndw_woo_discord_payload', function( $payload, $context ) {

    if ( ! isset( $payload['embeds'][0] ) ) {
    return $payload;
    }

    // --- Remove customer name and email fields ---
    $fields_to_remove = array( 'Customer', 'Email' );

    $payload['embeds'][0]['fields'] = array_values(
    array_filter(
    $payload['embeds'][0]['fields'],
    function( $field ) use ( $fields_to_remove ) {
    return ! in_array( $field['name'], $fields_to_remove, true );
    }
    )
    );

    // --- Override the embed colour per status ---
    $custom_colors = array(
    'completed' => 0x00b894, // teal
    'processing' => 0x0984e3, // bright blue
    'pending' => 0xfdcb6e, // yellow
    'on-hold' => 0xe17055, // orange
    'failed' => 0xd63031, // red
    'cancelled' => 0xb2bec3, // light grey
    'refunded' => 0x636e72, // dark grey
    'new_customer'=> 0xa29bfe, // purple
    );

    $status = $context['status'];
    if ( isset( $custom_colors[ $status ] ) ) {
    $payload['embeds'][0]['color'] = $custom_colors[ $status ];
    }

    return $payload;

    }, 10, 2 );
    Thread Starter xdekhckr

    (@xdekhckr)

    Yeah, thanks for info, I was just playing around and that was just my idea on how to make this plugin better and more customizable for everyone.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this review.