PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Automatically subscribing to comments

  1. So I'm using a Gravity Form (collecting email address etc) and I want the submitter to automatically receive notifications of any subsequent comments left on their post.

    I'm coming at this from originally using TDO Mini Forms in conjunction with Subscribe to Comments plugin.

    I basically hacked the TDO form which gave me access to the php of the whole form where I simply pasted the following code into the form. This code uses the functionality of Subscribe to Comments but automatically adds the submitters email address rather than them having to do it themselves:

    <fieldset>
    Vous serez automatiquement informé par e-mail des commentaires de suivi à votre demande. Vous pourrez vous désabonner après que le message est publié.<?php if(tdomf_widget_notifyme_show_email_input(2)) { ?>
    			<?php $sc_email = $subscribe_to_comments_email;
    			if(!isset($subscribe_to_comments_email)) {
    				if(isset($_COOKIE['comment_author_email_'])) {
    					$sc_email = $_COOKIE['comment_author_email_'];
    				} else if(isset($_COOKIE['tdomf_subscribe_to_comments_widget_email'])) {
    					$sc_email = $_COOKIE['tdomf_subscribe_to_comments_widget_email'];
    			 } } ?>
    			<br/><label for='subscribe_to_comments_email' class='required'>Courrier électronique pour la souscription commentaire (requis): <input type="text" value="<?php echo htmlentities($sc_email,ENT_QUOTES) ?>" name="subscribe_to_comments_email" id="subscribe_to_comments_email" size="40" /></label>
    		<?php } ?>
    	</fieldset>
    
    	<!-- notifyme start -->
    	<fieldset>
    	<label for='notifyme'><input type='checkbox' name='notifyme' id='notifyme' checked='yes'  style="display:none;" /></label>
    			</fieldset>
    	<!-- notifyme end -->

    So my question really is can I either:

    1) get access to the underlying php Gravity Form code in order to insert similar code above - and probably not just the php shortcode, but the underlying code for the whole form

    OR

    2) Is there a Gravity Form PHP widget that I can drag/drop onto the form to insert similar code that way instead?

    3) Is there a Gravity Form widget that integrates with a similar comment subscribing widget?

    Thanks

    Duncan

    Posted 9 years ago on Tuesday March 22, 2011 | Permalink
  2. You wouldn't implement this the same way, you would have to implement it using hooks/filters and some custom PHP you would add to your themes functions.php file to customize how Gravity Forms works.

    You would use the gform_post_submission hook. Here is a post that discusses it's use:

    http://www.gravityhelp.com/forums/topic/sms-api-gateway-need-help-to-get-gform-to-integrate#post-18087

    You would have to write the custom code or have a developer write the custom code to integrate with this 3rd party plugin.

    Posted 9 years ago on Tuesday March 22, 2011 | Permalink
  3. OK great. But I think you're saying that in principle it could be done, right?

    Cheers

    Duncan

    Posted 9 years ago on Wednesday March 23, 2011 | Permalink
  4. Yep, this is possible.

    Posted 9 years ago on Wednesday March 23, 2011 | Permalink