Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php if (!$_POST['newsletter-enviar']){ ?>
- <form id="newsletter-cadastro" method="post" action="">
- <input type="text" name="newsletter-email" class="newsletter-campo-texto" />
- <input type="submit" name="newsletter-enviar" class="newsletter-campo-enviar" value="Cadastrar" />
- </form>
- <?php }
- else {
- $email_inscrito = $_POST['newsletter-email'];
- echo $email_inscrito;
- $wpMail = new wpMail();
- if (class_exists('wpMail')) {
- echo 1;
- if ($wpMail = new wpMail()) {
- echo 2;
- global $Subscriber;
- $subscriber = array(
- 'email' => $email_inscrito, //the email of the subscriber
- 'list_type' => "specific", //always leave this "specific"
- 'list_id' => "2", //the ID of the mailing list to subscribe to
- );
- if ($Subscriber -> optin($subscriber, true)) {
- echo "Usuario cadastrado";
- } else { echo 'FAILED'; }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement