Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.94 KB | None | 0 0
  1.         <?php if (!$_POST['newsletter-enviar']){ ?>
  2.             <form id="newsletter-cadastro" method="post" action="">
  3.                 <input type="text" name="newsletter-email" class="newsletter-campo-texto" />
  4.                 <input type="submit" name="newsletter-enviar" class="newsletter-campo-enviar" value="Cadastrar" />
  5.             </form>
  6.         <?php }
  7.        
  8.         else {
  9.             $email_inscrito = $_POST['newsletter-email'];
  10.             echo $email_inscrito;
  11.             $wpMail = new wpMail();
  12.             if (class_exists('wpMail')) {
  13. echo 1;
  14.  
  15.                 if ($wpMail = new wpMail()) {
  16. echo 2;
  17.  
  18.                     global $Subscriber;
  19.                    
  20.                     $subscriber = array(
  21.                         'email'             =>  $email_inscrito,        //the email of the subscriber
  22.                         'list_type'         =>  "specific",             //always leave this "specific"
  23.                         'list_id'           =>  "2",                    //the ID of the mailing list to subscribe to
  24.                     );
  25.                    
  26.                     if ($Subscriber -> optin($subscriber, true)) {
  27.                         echo "Usuario cadastrado";
  28.                     } else { echo 'FAILED'; }
  29.                 }
  30.             }
  31.         }
  32.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement