ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Mailing List - Mad Mimi Integration

September 24, 2009 12:38am

Subscribe [2]
  • #1 / Sep 24, 2009 12:38am

    Sheye Rosemeyer

    39 posts

    This is how I integrated the registration with Mad Mimi using their free API.

    When someone registers I use the following code to post the new user email to a mailing list managed by Mad Mimi.


    I have the registration redirect adding ?m=1 to the end of my URL which I use to add the user only once as they’ll never see that again.

    <?php 
    global $SESS; 
    $uid = $SESS->userdata['member_id'];
    
    
    if($_GET['m']){
    $username = 'YOUR EMAIL ADDRESS';
    $api_key = 'YOUR API KEY';
    $mimiE = $SESS->userdata['email'];
    $mimiN = $SESS->userdata['screen_name'];
    $csv_data = "name,email,add_list\n.".$mimiN.",".$mimiE.",LIST NAME";
    
    
    $ch = curl_init('http://madmimi.com/audience_members');
    curl_setopt($ch, CURLOPT_POST, TRUE);
    curl_setopt($ch, CURLOPT_POSTFIELDS,
    'username='.$username.'&api;_key='.$api_key.'&csv;_file='.$csv_data);
    $response = curl_exec($ch);
    
    // TESTING 
    //echo $response;
    }
    
    ?>
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases