Last active
December 12, 2015 05:48
-
-
Save thoronas/87633873faef07196bc8 to your computer and use it in GitHub Desktop.
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
// gravity forms version of email function | |
function gforms_notify_users_new_post($entry, $form) { | |
$post = get_post($entry["post_id"]); | |
$terms = get_the_terms( $post->ID, 'ad-categories' ); | |
$author_email = "forgeandsmith@gmail.com"; | |
$email_subject = "test"; | |
ob_start(); ?> | |
<html> | |
<head> | |
</head> | |
<body> | |
<p> | |
Someone posted something new!. | |
</p> | |
<?php | |
var_dump($post); | |
echo "<br />"; | |
var_dump($terms); | |
?> | |
<p> | |
Log in and <a href="<?php echo get_permalink($post->ID) ?>">view the post</a>. | |
</p> | |
<p> | |
Regards,<br /> | |
I Waaant It, Inc. | |
</p> | |
</body> | |
</html> | |
<?php | |
$message = ob_get_contents(); | |
ob_end_clean(); | |
wp_mail( $author_email, $email_subject, $message ); | |
} | |
/* | |
This function is not working properly right now. The users are not being passed to the email function. I believe there is some problem with the user query. | |
*/ | |
add_action("gform_after_submission", "gforms_notify_users_new_post", 100, 2); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment