Referral Notifications To Administrator

Hi, I would like to include more information in my notification emails sent to the Administrator.

When a referral registers using an affiliate link, I would like to include in the Admin Notification Email the Affiliate Phone Number and Company Name on file. (provided when an affiliate registers)

As of right now I can only include Affiliate Name and Email, since there are shortcodes for those items.

I can’t use CF7 tokens, because they would be referencing the tokens from the referral form right?

Thanks!


Comments

10 responses to “Referral Notifications To Administrator”

  1. Perfect!

  2. Awesome, thank you so much! I have adjusted the field names and will install the plugin now. Thanks again

  3. Hi Andrew,

    I have sent you a plugin for adding more tokens for Affiliates referral notifications.
    You should download the .zip file and upload it as you would with any other plugin.

    After activating it, you can use [affiliate_phone] and [company_name] tokens.
    Please note that in order for these fields to be rendered properly, in your affiliate registration form you should use a field named phone and a field named company_name. Also, for the field labels you are free to use whatever you like.

    Kind regards,

    George

  4. Hi George, thanks for the reply.

    I guess my confusion is in the labeling – basically how to correctly match the my created database fields of Affiliate Company and Affiliate Phone to the labels in the code?

    Since I’m not great with PHP, with this type of stuff I always try and reverse engineer it. So if I saw the functions code for how it calls the Email or ID, I could just copy the syntax and replace with my labels.

    But I will wait for your reply…thanks again!

  5. Hi Andrew,

    It’s the same thing for the system, after all this is just a label.
    I will prepare a snippet myself for this and let you know.

    Cheers,
    George

  6. Or actually would it be [affiliates_affiliate_phone] and [affiliates_affiliate_company] ?

  7. Oh ok, great thanks!

    So the data I want to use is the Affiliate “Company” and “Phone”, so my tokens would be [affiliate_phone] and [affiliate_company] ?

    After I place the code in the functions file I can insert those tokens into my email template and it will produce the Company and Phone that is on file for that affiliate?

    Thanks for your patience, I’m not great with PHP 🙂

  8. Hi Andrew,

    Filters and actions reference can be found in the WordPress Codex.

    Regarding the filter in question, you can use the following snippet as reference:

    add_filter( 'affiliates_notifications_tokens', 'example_affiliates_notifications_tokens' );
    function example_affiliates_notifications_tokens( $tokens ) {
    $tokens['your_token_name'] = 'your_token_value';

    return $tokens;
    }

    The snippet should be placed in functions.php file of your active theme.
    If you add [your_token_name] in the notification template, the mail message will render your_token_value.

    If you need further assistance, please add a comment here.

    Kind regards,
    George

  9. Thank you for the reply. This is under API, so I’m not really sure how I’m supposed to implement that on my site?

  10. Hi Andrew,

    Please have a look at affiliates_notifications_tokens hook. You can modify the $tokens array and add yours at will witht.
    After that and as long as the phone number and company name are stored, they will be displayed to the admin notification email.

    Kind regards,
    George

Share