Integrate Amember with Aweber

Discussion in 'Integration' started by pamb10, Jan 29, 2017.

  1. pamb10

    pamb10 New Member

    Joined:
    Aug 29, 2011
    Messages:
    18
    How can I integrate buyers to an Aweber list.

    I have tried suggestions on the forum but it seems they are from older versions.

    When I select newsletter module from the plugins tab, no new aweber tab shows up.

    Can someone point me in the right direction?

    Thanks
    Pam
  2. pamb10

    pamb10 New Member

    Joined:
    Aug 29, 2011
    Messages:
    18
    Ok, I got it integrated but it didnt seem to work. How long should it take for the user to be added to aweber?
  3. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Did you associate aMember products with aweber lists already?
    aMember CP -> Protect Content -> Newsletter
  4. pamb10

    pamb10 New Member

    Joined:
    Aug 29, 2011
    Messages:
    18
    Thank you Ceasar. I have now associated a product with a list. How can I add an affiliate user to a list? There is no product to associate, just signing up as an affiliate.
  5. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    I suggest the following workaround:

    1. Create new Product - Affiliate, make this product disabled so no one can purchase it.

    2. use the following code in site.php to automatically add this product to user account in case of he become affiliate
    http://www.amember.com/docs/Site.php_file
    Code:
    Am_Di::getInstance()->hook->add(array(Am_Event::USER_AFTER_INSERT, Am_Event::USER_AFTER_UPDATE),
        function (Am_Event $e) {
    
            $product_id = 27;
    
            /* @var $u User */
            $u = $e->getUser();
            if ($u->is_affiliate && !in_array($product_id, $u->getActiveProductIds())) {
                $e->getDi()->accessTable->insert(array(
                    'user_id' => $u->pk(),
                    'begin_date' => sqlDate('now'),
                    'expire_date' => Am_Period::MAX_SQL_DATE,
                    'product_id' => $product_id
                ));
                $u->checkSubscriptions(true);
            }
        });
    in code above you need to replace 27 with actual id of Affiliate product

    3. use product Affiliate as condition in Access Permissions

    It should do the trick.

    Best Regards.

Share This Page