beaverbuilder / feature-requests

Feature request board for Beaver Builder products.
26 stars 4 forks source link

Please Add Email Notifications To Subscribe Forms When Using A CRM Integration #328

Closed TNHSAesop closed 10 months ago

TNHSAesop commented 1 year ago

When using the beaver builder subscribe forms without a CRM integration you are able to receive a notification with the person who subscribed's email address. However when using a CRM integration that notification email disappears. I'm having a few instances where my CRM's API may be offline for whatever reason and the subscription fails. Since I am not getting a notification sent to my email address the subscriber's information is lost in the void. I would like to also receive the email notification that is sent when not using a CRM integration while using that feature.

Pross commented 10 months ago

The subscribe module has various filters. You can use one to email yourself when someone subscribes:

add_action( 'fl_builder_subscribe_form_submission_complete', function( $response, $settings, $email, $name, $template_id, $post_id ) {
    $subject = 'New submission';
    $message = sprintf( "Name: %s\nEmail: %s", $name, $email );
    $result = wp_mail( 'me@example.com', $subject, $message );
}, 10, 6 ); 

The $response variable will be an array, if the submission has an error it will be in that array.