Add name of product sold by affiliate to notification

Hi,

When an affiliate gets a commission I would like him to get a notification which is possible right now.
But can I add in the mail the name of product that got him the sale?
Even if I can add the woocommerce ID of the product it would be good.

Thanks,
Chen

3 Responses to Add name of product sold by affiliate to notification

  1. Hendra Trisnayadi December 31, 2018 at 11:05 am #

    Hi Oren,

    To create a token, you need to understand filter and hooks in WordPress. you can see the code example below how to add token :

    add_filter( ‘affiliates_notifications_tokens’, ‘example_affiliates_notifications_tokens’ );

    function example_affiliates_notifications_tokens( $tokens ) {
    $tokens[‘your_custom_token_name’] = ‘your custom token value’;
    return $tokens;
    }

    Kind regard,
    hendra

  2. orenedree December 29, 2018 at 11:35 pm #

    hi hendra,

    Thanks

    Can you tell me how to create this token?

    Thanks,
    Oren

  3. Hendra Trisnayadi December 29, 2018 at 1:50 pm #

    Hi,

    You need a custom implementation to do that, you can create a notification token to the mail template, please see this git repo as references :

    https://github.com/geotsiokos/affiliates-addtional-tokens

    FYI, the notification token is similar to a shortcode.

    Kind regards,
    hendra

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share