Created
January 31, 2014 18:46
-
-
Save leobaiano/8739891 to your computer and use it in GitHub Desktop.
Envia notificação por e-mail quando tem comentário no comment form do facebook (WordPress)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Avisar quando houver comentários facebook no post | |
add_action( 'wp_ajax_facebook_comment_post', 'avisar_facebook_comment_post' ); | |
add_action( 'wp_ajax_nopriv_facebook_comment_post', 'avisar_facebook_comment_post' ); | |
function avisar_facebook_comment_post(){ | |
$url = $_GET['post_url']; | |
$nome = "Kiwi!"; | |
$email = "alo@kiwicomcasca.com.br"; | |
$para = "jleonardosmatos@gmail.com"; | |
$assunto = "Novo comentário no Kiwi com Casca"; | |
$conteudo = "Alguém comentou o post <a href='" . $url . "'>" . $url . "</a>"; | |
$envio = enviarEmail($nome,$email,$para,$assunto,$conteudo); | |
if($envio){ | |
$status = array( | |
"status" => 1, | |
"mensagem" => "E-mail enviado com sucesso." | |
); | |
} | |
else{ | |
$status = array( | |
"status" => 0, | |
"mensagem" => "Ocorreu algum erro e o e-mail não foi enviado." | |
); | |
} | |
echo json_encode($status); | |
die(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment