Title: Add filter before email send
Last modified: November 14, 2019

---

# Add filter before email send

 *  Resolved [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/add-filter-before-email-send/)
 * Hey,
    I’m the developer of the [Kadence WooCommerce Email Designer](https://wordpress.org/plugins/kadence-woocommerce-email-designer/)
   plugin.
 * I love your plugin and would like to add special support for it in my email designer
   plugin.
 * I’ve built out some testing support that would allow users to send your abandon
   cart emails as html emails designed the same way their transactional emails are
   designed. They would also be able to preview the emails in my plugin.
 * For this, to work I would need you to add a couple of lines of code to your plugin
   to allow the emails to be filtered through woocommerce before they are sent.
 * One example for how this could work would be to change lines 1710-1720 of class-
   cartflows-ca-cart-abandonment.php from this:
 *     ```
       $mail_result        = wp_mail( $email_data->email, $subject_email_preview, stripslashes( $body_email_preview ), $headers );
       				if ( $mail_result ) {
       					return true;
       				} else {
       					// Retry sending mail.
       					$mail_result = wp_mail( $email_data->email, $subject_email_preview, stripslashes( $body_email_preview ), $headers );
       					if ( ! $preview_email ) {
       						return true;
       					}
       					return false;
       				}
       ```
   
 * To this:
 *     ```
       $mail_result        = apply_filters( 'woo_cart_abandonment_recovery_email_override', false, $email_data->email, $subject_email_preview, stripslashes( $body_email_preview ), $headers, $email_data );
       			if ( $mail_result ) {
       				return true;
       			} else {
       				$mail_result        = wp_mail( $email_data->email, $subject_email_preview, stripslashes( $body_email_preview ), $headers );
       				if ( $mail_result ) {
       					return true;
       				} else {
       					// Retry sending mail.
       					$mail_result = wp_mail( $email_data->email, $subject_email_preview, stripslashes( $body_email_preview ), $headers );
       					if ( ! $preview_email ) {
       						return true;
       					}
       					return false;
       				}
       			}
       ```
   
 * Please let me know if adding a filter would be possible and if I can help by 
   submitting a pull request.
 * Thanks for your time!
 * Ben

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

 *  Plugin Support [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * (@cartflows)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/add-filter-before-email-send/#post-12130982)
 * Hello [@britner](https://wordpress.org/support/users/britner/),
 * Thank you for showing interest in our plugin.
 * We really appreciate your efforts taken by you to support our plugin.
 * We’ve added this task to our development queue and we’ll let you know when we
   ready with this feature.
 * Thank you!
 *  Thread Starter [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/add-filter-before-email-send/#post-12133701)
 * Thanks, looking forward to the update! Let me know If I can be of assistance.
 * Ben
 *  Plugin Support [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * (@cartflows)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/add-filter-before-email-send/#post-12135421)
 * Hello [@britner](https://wordpress.org/support/users/britner/),
 * Yes, We will let you if we need any assistance.
 * Thank You!
 *  Thread Starter [Ben Ritner – Kadence WP](https://wordpress.org/support/users/britner/)
 * (@britner)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-filter-before-email-send/#post-12235699)
 * Hey [@cartflows](https://wordpress.org/support/users/cartflows/)
    Any news on
   when a filter could be added? I checked your recent update and didn’t see one.
 * Ben
 *  Plugin Support [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * (@cartflows)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/add-filter-before-email-send/#post-12242697)
 * Hello [@britner](https://wordpress.org/support/users/britner/),
 * Apologize for delay in response.
 * We are working on it, we will try to add this filter in the next release.
 * Your patience and co-operation are highly appreciated.
 * Thank you.

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

The topic ‘Add filter before email send’ is closed to new replies.

 * ![](https://ps.w.org/woo-cart-abandonment-recovery/assets/icon-256x256.gif?rev
   =3370405)
 * [Cart Abandonment Recovery for WooCommerce – Recover Lost Sales with Automated Emails](https://wordpress.org/plugins/woo-cart-abandonment-recovery/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woo-cart-abandonment-recovery/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woo-cart-abandonment-recovery/)
 * [Active Topics](https://wordpress.org/support/plugin/woo-cart-abandonment-recovery/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woo-cart-abandonment-recovery/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woo-cart-abandonment-recovery/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [CartFlows Team](https://wordpress.org/support/users/cartflows/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/add-filter-before-email-send/#post-12242697)
 * Status: resolved