Referral Notifications To Administrator

Posted in

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!

10 Responses to Referral Notifications To Administrator

  1. George June 26, 2018 at 8:32 pm #

    Perfect!

  2. Andrew June 26, 2018 at 1:57 pm #

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

  3. George June 25, 2018 at 4:52 pm #

    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. Andrew June 25, 2018 at 1:15 pm #

    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. George June 25, 2018 at 10:43 am #

    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. Andrew June 24, 2018 at 4:49 pm #

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

  7. Andrew June 24, 2018 at 4:34 pm #

    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. George June 24, 2018 at 3:12 pm #

    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. Andrew June 23, 2018 at 2:23 pm #

    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. George June 22, 2018 at 7:46 pm #

    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

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