Advertisement
tribulant

Untitled

Feb 26th, 2014
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. global $current_user;
  2. get_currentuserinfo();
  3.  
  4. if (class_exists('wpMail')) {
  5.     $wpMail = new wpMail();
  6.     global $Subscriber;
  7.  
  8.     $data = array(
  9.         'email' => $current_user -> user_email,
  10.         'list_id' => array(2),
  11.         'mailinglists' => array(2),
  12.         'firstname' => "Andrew",
  13.         'lastname' => "Traub",
  14.     );
  15.  
  16.     if ($Subscriber -> email_validate($current_user -> user_email) && $Subscriber -> optin($data, false)) {
  17.         //success
  18.     } else {
  19.         print_r($Subscriber -> errors);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement