<?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: Inserting newly created post ID into content template?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/inserting-newly-created-post-id-into-content-template</link>
		<description>Gravity Support Forums Topic: Inserting newly created post ID into content template?</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 09:44:32 +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/inserting-newly-created-post-id-into-content-template" rel="self" type="application/rss+xml" />

		<item>
			<title>sascha on "Inserting newly created post ID into content template?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/inserting-newly-created-post-id-into-content-template#post-49173</link>
			<pubDate>Sat, 11 Feb 2012 21:43:42 +0000</pubDate>
			<dc:creator>sascha</dc:creator>
			<guid isPermaLink="false">49173@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks David,&#60;br /&#62;
will give this a go!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Inserting newly created post ID into content template?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/inserting-newly-created-post-id-into-content-template#post-49161</link>
			<pubDate>Sat, 11 Feb 2012 16:10:53 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">49161@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Sascha,&#60;/p&#62;
&#60;p&#62;If a custom email is being sent via the gform_after_submission hook you can retrieve the created post ID from the $entry object which is passed by the hook.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
$post_id = $entry[&#38;#39;post_id&#38;#39;];&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Once you have the $post_id you can generate the permalink like so:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
$permalink = get_permalink($post_id);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Add the $permalink variable wherever you'd like it to display in your email.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sascha on "Inserting newly created post ID into content template?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/inserting-newly-created-post-id-into-content-template#post-49159</link>
			<pubDate>Sat, 11 Feb 2012 16:00:57 +0000</pubDate>
			<dc:creator>sascha</dc:creator>
			<guid isPermaLink="false">49159@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi David,&#60;/p&#62;
&#60;p&#62;I basically have a custom field which is called &#34;message to design office&#34; which can be filled in by the user. The user writes an article about the design office and wants to let them know that he published an article on the website (ID of the created post). The email is sent via a gform after submission hook. So in the content template I would like to use the link to the just created post to let the design office know where they can find the article/post.&#60;br /&#62;
Hope that is clear...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Inserting newly created post ID into content template?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/inserting-newly-created-post-id-into-content-template#post-49097</link>
			<pubDate>Fri, 10 Feb 2012 21:50:15 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">49097@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Sascha,&#60;/p&#62;
&#60;p&#62;It doesn't look like the {post_id} merge tag works in the Content Template context. Could you give me some more details on your setup and I'll see if there is something I can cook up for you?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sascha on "Inserting newly created post ID into content template?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/inserting-newly-created-post-id-into-content-template#post-48339</link>
			<pubDate>Sat, 04 Feb 2012 09:04:58 +0000</pubDate>
			<dc:creator>sascha</dc:creator>
			<guid isPermaLink="false">48339@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi there,&#60;br /&#62;
is there a way to get the ID of the newly created post into a content template? Basically I would like to send a person an email (text of email comes from a custom field content template) when the post is created and give them the link to the newly created post. I was thinking of getting the post id to do this. But maybe there is an easier, better way?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
