Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter xcastaneda

    (@xcastaneda)

    To anyone that has had this issue when using Gravity Forms Manual activation in conjunction with an HTML template plugin like WP Better Emails, I found a simple workaround.

    By default, the wordpress mail function will check if an email is empty before sending out. When using GF manual activation, GF passes an empty string to WP mail which WordPress normally catches and prevents from sending out. However, since WP Better Emails wraps the body message with the HTML template, it actually fools WP into thinking it is a legit email that should go out. Thus, you get a perfectly templated HTML email with a blank %content% message.

    The answer is to simply check that the body is not blank before applying the template.

    I did this by modifying the line at roughly 391 in wpbe.php (set_email_template function) from

    return str_replace( '%content%', $body, $template );

    to this

    if( $body ){
    	return str_replace( '%content%', $body, $template );
    }

    I assume this is the same issue any other HTML templating plugin like SB Welcome has.

    I hope this helps someone else out there who like me wants all emails to templated and wants to use Gravity Form Manual activation.

    Thread Starter xcastaneda

    (@xcastaneda)

    The issue seems to be specific to GravityForms User Registration. I tried another WP HTML Email plugin and it sent the same blank activate email.

    Setting as closed and will reach out to Gravity Forms developer.

Viewing 2 replies - 1 through 2 (of 2 total)