<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: Email notification not sending after deleting entry with hook</title>
		<link>https://legacy.forums.gravityhelp.com/topic/email-notification-not-sending-after-deleting-entry-with-hook</link>
		<description>Gravity Support Forums Topic: Email notification not sending after deleting entry with hook</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 23:39:45 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/email-notification-not-sending-after-deleting-entry-with-hook" rel="self" type="application/rss+xml" />

		<item>
			<title>45north on "Email notification not sending after deleting entry with hook"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/email-notification-not-sending-after-deleting-entry-with-hook#post-52491</link>
			<pubDate>Thu, 15 Mar 2012 01:30:06 +0000</pubDate>
			<dc:creator>45north</dc:creator>
			<guid isPermaLink="false">52491@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I'm deleting form records after submission using gform_post_submission and have also tried gform_after_submission.  Deleting the record works great, but I no longer get the email notification - if I comment out deleting the entry from the database I get the email no problem.  It looks like these hooks are before the user email notifications are sent out - is there a way to manually force-send the email notification or use the hook differently to make sure notifications go out?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;#39;gform_post_submission_1&#38;#39;, &#38;#39;process_order&#38;#39;, 10, 2);

function process_order($entry, $form)
{
	// do stuff
	remove_form_entry($entry[&#38;#39;id&#38;#39;]);
}

function remove_form_entry($entryId)
{
	global $wpdb;

	$lead_id = $entryId;
	$lead_table = RGFormsModel::get_lead_table_name();
	$lead_notes_table = RGFormsModel::get_lead_notes_table_name();
	$lead_detail_table = RGFormsModel::get_lead_details_table_name();
	$lead_detail_long_table = RGFormsModel::get_lead_details_long_table_name();

	//Delete from detail long
	$sql = $wpdb-&#38;gt;prepare(&#38;quot; DELETE FROM $lead_detail_long_table
		WHERE lead_detail_id IN(
			SELECT id FROM $lead_detail_table WHERE lead_id=%d
		)&#38;quot;, $lead_id);
	$wpdb-&#38;gt;query($sql);

	//Delete from lead details
	$sql = $wpdb-&#38;gt;prepare(&#38;quot;DELETE FROM $lead_detail_table WHERE lead_id=%d&#38;quot;, $lead_id);
	$wpdb-&#38;gt;query($sql);

	//Delete from lead notes
	$sql = $wpdb-&#38;gt;prepare(&#38;quot;DELETE FROM $lead_notes_table WHERE lead_id=%d&#38;quot;, $lead_id);
	$wpdb-&#38;gt;query($sql);

	//Delete from lead
	$sql = $wpdb-&#38;gt;prepare(&#38;quot;DELETE FROM $lead_table WHERE id=%d&#38;quot;, $lead_id);
	$wpdb-&#38;gt;query($sql);
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
