Is Invite integrated with Affiliate?

I am creating a multisite for businesses to connect with their customers so putting affiliate ads on the visible subsites is not desired. However, I still would like the businesses to promote to other businesses for affiliatecommissions. I was thinking that rather than banner ads, the "Invite" plugin could work - but how does one get the affiliate code into the email?

  • Vaughan

    Hi @antkat,

    Currently, no these 2 plugins aren't integrated with each other. But it does sound like a great idea. I will certainly add this to the feature requests for the developer to look into.

    It might be possible with a simple mod to the plugin.

    Open invite.php

    find the following around line 94.

    global $wpdb, $wp_roles, $current_user, $user_ID, $current_site, $current_blog, $invite_message_subject, $invite_message_content, $invite_from_email;

    Add this right after on the next line.

    $aff_ref = $wpdb->get_user_meta($user_ID, 'affiliate_reference', true);

    So it should now look like;

    global $wpdb, $wp_roles, $current_user, $user_ID, $current_site, $current_blog, $invite_message_subject, $invite_message_content, $invite_from_email;
    
        $aff_ref = $wpdb->get_user_meta($user_ID, 'affiliate_reference', true);

    Find this around line 108.

    $message_content = str_replace( "SIGNUP_URL", network_home_url('wp-login.php?action=register'), $message_content );

    Replace with;

    if(isset($aff_ref) && $aff_ref !=='') {
            $message_content = str_replace( "SIGNUP_URL", network_home_url('wp-login.php?action=register?ref=' . $aff_ref), $message_content );
        } else {
            $message_content = str_replace( "SIGNUP_URL", network_home_url('wp-login.php?action=register'), $message_content );
        }

    Hopefully that should work, I haven't tested though.

    Hope this helps