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.89 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.                 if ($wpMail = new wpMail()) {
  14.                     global $Subscriber;
  15.                    
  16.                     $subscriber = array(
  17.                         'email'             =>  $email_inscrito,        //the email of the subscriber
  18.                         'list_type'         =>  "specific",             //always leave this "specific"
  19.                         'list_id'           =>  "2",                    //the ID of the mailing list to subscribe to
  20.                     );
  21.                    
  22.                     if ($Subscriber -> optin($subscriber, true)) {
  23.                         echo "Usuario cadastrado";
  24.                     }
  25.                 }
  26.             }
  27.         }
  28.         ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement