How to get ClickBank to Email You When You Make New Sales---Improved version!

Discussion in 'ClickBank' started by Bonus4You.info, Oct 18, 2008.

  1. #1
    As a Clickbank affiliate, do you have the habit to check your data every 20 minutes?

    ScoTech has posted a script here:
    http://forums.digitalpoint.com/showthread.php?p=8675162
    And we also discussed the script here:
    http://forums.digitalpoint.com/showthread.php?t=1011795

    With this simple script, you can receive email notification instantly without login to your clickbank account.

    This version of script requires the php function mail(),but maybe your hosting company do not allow you to use this function, so I have made some modifications. Then you can use smtp provided by any other email servers. I have tested this script with gmail and it worked perfectly!

    Make a new file mail.php
    
    <?php
    function cbValid()
    {   
    $key=' You Own Secret Key';   
    $ccustname = $_REQUEST['ccustname'];   
      $ccustemail = $_REQUEST['ccustemail'];    
      $ccustcc = $_REQUEST['ccustcc'];    
      $ccuststate = $_REQUEST['ccuststate'];    
      $ctransreceipt = $_REQUEST['ctransreceipt'];    
      $cproditem = $_REQUEST['cproditem'];    
      $ctransaction = $_REQUEST['ctransaction'];   
      $ctransaffiliate = $_REQUEST['ctransaffiliate'];   
      $ctranspublisher = $_REQUEST['ctranspublisher'];    
      $cprodtype = $_REQUEST['cprodtype'];   
      $cprodtitle = $_REQUEST['cprodtitle'];   
      $ctranspaymentmethod = $_REQUEST['ctranspaymentmethod'];    
      $ctransamount = $_REQUEST['ctransamount'];    
      $caffitid = $_REQUEST['caffitid'];    
      $cvendthru = $_REQUEST['cvendthru'];    
      $cbpop = $_REQUEST['cverify'];           
       $xxpop = sha1("$ccustname|$ccustemail|$ccustcc|$ccuststate|$ctransreceipt|$cproditem|$ctransaction|"        ."$ctransaffiliate|$ctranspublisher|$cprodtype|$cprodtitle|$ctranspaymentmethod|$ctransamount|$caffitid|$cvendthru|$key");   
       $xxpop=strtoupper(substr($xxpop,0,8));    
       if ($cbpop==$xxpop) return 1;    
       else return 0;
       }
       
       /*If your hosting company allow you to use mail(),you can use this code and delete all of the following lines:
       if (cbValid())mail("kandypp@139.com", "ClickBank - " . $_REQUEST['ctransaction'],"Product: " . $_REQUEST['cprodtitle'] . "\nPublisher: " . $_REQUEST['ctranspublisher'] . "\nAffiliate: " . $_REQUEST['ctransaffiliate'] . "\nTransaction: " . $_REQUEST['ctransaction'] . "\nAmount: " . $_REQUEST['ctransamount'] . "\nTid: " . $_REQUEST['caffitid']);
       */
    
      //If your hosting company do not support mail (), please use the following code and send email by using other smtp server such as gmail.
      require_once 'Mail.php';
    
      $conf['mail'] = array(
        'host' => 'smtp.gmail.com', //smtp server, ip address or domain are both OK
        'auth' => true, //true mean the smtp server requires authorzation, false means no need
        'username' => 'Gmail_Username@gmail.com', //Username
        'password' => 'Gmail_Password' //Password
      );
    
      $headers['From'] = 'Gmail_Username@gmail.com'; //Your email address with the smtp server
      $headers['To'] = 'YourEmail@AnyDomain.com'; //Your email address used to receive notifications
      $headers['Subject'] = 'ClickBank Sales - '.$_REQUEST['ctransaction']; //Title
      $mail_object = &Mail::factory('smtp', $conf['mail']);
    
      $body = "Product: " . $_REQUEST['cprodtitle'] . "\nPublisher: " . $_REQUEST['ctranspublisher'] . "\nAffiliate: " . $_REQUEST['ctransaffiliate'] . "\nTransaction: " . $_REQUEST['ctransaction'] . "\nAmount: " . $_REQUEST['ctransamount'] . "\nTid: " . $_REQUEST['caffitid'];
    
      $mail_res = $mail_object->send($headers['To'], $headers, $body); //Send
    
      if (PEAR::isError($mail_res)) {
       echo("<p>" . $mail->getMessage() . "</p>");
    } else {
       echo("<p>Message successfully sent!</p>");
    }
    
    ?>
    
    PHP:
    Remember to change these things:

    1: $key='Your Own Secret Key'; Uppercase letters and numbers only
    2: 'username' => 'Gmail_Username@gmail.com', //Your gmail address or other email address with smtp server
    3: 'password' => 'Gmail_Password' //Your password for gmail or other email address.
    4: $headers['From'] = 'Gmail_Username@gmail.com'; //The same as point 2
    5:$headers['To'] = 'YourEmail@AnyDomain.com'; //Your Email address used to receive email notifications.

    Upload this file to your web server, Then
    1. Log into your account
    2. Click the "Account Settings" tab
    3. Click "My Site" in the sub nav
    4. Locate the "Instant Notification" field and click the "Click HERE to request access" hyper link
    5. Fill out the form and thoroughly review the terms of use.
    6. Click the "Submit" button at the bottom of the form
    7. Enter a Secret Key (Uppercase letters and numbers only) into the "My Site" Screen
    8. Enter the URL of the file you uploaded to your site into the Instant Notification Box
    9. Hit Save Changes
    10. Click on Test next to the address you entered, and you should get a test email!

    Note: If your cell phone providers can forward emails to your phone, you would just put your phone email in instead of an address, then you can receive sms notification when you make a sale!

    I have also put the code of the php file on my Google Docs, please go to my website and download it:
    http://www.bonus4you.info/2008/10/how-to-get-clickbank-to-email-you-when.html

    Terry Bonus4You.info
     
    Bonus4You.info, Oct 18, 2008 IP
  2. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #2
    I mean is it safe for people to use it or can people get your secret code from the code.
     
    TheSyndicate, Oct 18, 2008 IP
  3. Bonus4You.info

    Bonus4You.info Peon

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Bonus4You.info, Oct 18, 2008 IP
  4. bl4ckmaN^

    bl4ckmaN^ Well-Known Member

    Messages:
    4,641
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    165
    #4
    bl4ckmaN^, Oct 19, 2008 IP
  5. mikey1090

    mikey1090 Moderator Staff

    Messages:
    15,869
    Likes Received:
    1,055
    Best Answers:
    0
    Trophy Points:
    445
    Digital Goods:
    2
    #5
    Cbnotify is quite slow and you don't know what they do with the data. A php script on your own server is more secure.
     
    mikey1090, Oct 19, 2008 IP
  6. JoseArmando

    JoseArmando Active Member

    Messages:
    807
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    70
    #6
    Clickbank is sending me emails about my sales without any scripts...

    I don't really see the purpose of all these sites and scripts if you can have clickbank to do it instead.
     
    JoseArmando, Oct 19, 2008 IP
  7. mikey1090

    mikey1090 Moderator Staff

    Messages:
    15,869
    Likes Received:
    1,055
    Best Answers:
    0
    Trophy Points:
    445
    Digital Goods:
    2
    #7
    This is for affiliates, not publishers.
     
    mikey1090, Oct 19, 2008 IP
  8. Bonus4You.info

    Bonus4You.info Peon

    Messages:
    112
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yes, as mikey1090 said, this is for publisher, but the script is for both publisher and affiliate
     
    Bonus4You.info, Oct 19, 2008 IP
  9. JoseArmando

    JoseArmando Active Member

    Messages:
    807
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    70
    #9
    Ah I see. I never made a lot of sales as an affiliate so I thought they implemented this recently :D
     
    JoseArmando, Oct 19, 2008 IP
  10. seregap

    seregap Active Member

    Messages:
    276
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #10
    doesn't work for me. googlemail requires STARTTLS (whatever it is) to access smtp
    is google mail different to gmail? i thought it was the same
     
    seregap, Oct 19, 2008 IP
  11. bl4ckmaN^

    bl4ckmaN^ Well-Known Member

    Messages:
    4,641
    Likes Received:
    60
    Best Answers:
    0
    Trophy Points:
    165
    #11
    Google mail should be the same as Gmail ;)
     
    bl4ckmaN^, Oct 19, 2008 IP
  12. hamidap

    hamidap Active Member

    Messages:
    665
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    80
    Articles:
    6
    #12
    Thanks for that - I hadn't even heard of it before but I installed it today and it works nicely.
     
    hamidap, Oct 19, 2008 IP
  13. seregap

    seregap Active Member

    Messages:
    276
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    60
    #13
    yeah that's what i thought.
    so i don't get how the topicstarter managed to use the code with gmail when it asks for TSL connection to access smtp server.
     
    seregap, Oct 19, 2008 IP
  14. SUB

    SUB Well-Known Member

    Messages:
    577
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    108
    #14
    this seems interesting, will check this out later.
     
    SUB, Oct 19, 2008 IP