<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[FreeMarker error: postMethod variable null in registration verify template]]></title><description><![CDATA[<p dir="auto">I'm encountering a FreeMarker template error when users click a verification link, specifically on the registration verify page. The error indicates that the <code>postMethod</code> variable is evaluating to null:</p>
<pre><code>FreeMarker template error:
The following has evaluated to null or missing:
==&gt; postMethod  [in template "registration/verify.ftl" at line 16, column 30]
</code></pre>
<p dir="auto">The problematic line in my <code>registration/verify.ftl</code> template is:</p>
<pre><code class="language-freemarker">[#if verificationId?? &amp;&amp; postMethod]
</code></pre>
<p dir="auto">This error seems to occur when the verification link is clicked a second time. The stack trace shows:</p>
<pre><code>freemarker.core.InvalidReferenceException
  at freemarker.core.NonBooleanException.&lt;init&gt;
  at freemarker.core.Expression.modelToBoolean
  at freemarker.core.AndExpression.evalToBoolean
  at freemarker.core.IfBlock.accept
</code></pre>
<p dir="auto">Is there a recommended way to handle this variable safely in the template to prevent this error?</p>
]]></description><link>https://fusionauth.io/community/forum/topic/3258/freemarker-error-postmethod-variable-null-in-registration-verify-template</link><generator>RSS for Node</generator><lastBuildDate>Fri, 16 Oct 2026 14:18:49 GMT</lastBuildDate><atom:link href="https://fusionauth.io/community/forum/topic/3258.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 13 Oct 2026 19:03:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to FreeMarker error: postMethod variable null in registration verify template on Tue, 13 Oct 2026 19:03:19 GMT]]></title><description><![CDATA[<p dir="auto">The <code>postMethod</code> variable can be null or missing in certain scenarios (such as when a verification link is clicked multiple times), causing the FreeMarker template to fail.</p>
<p dir="auto">To fix this, you need to provide a safe fallback for the <code>postMethod</code> variable. Update line 16 in your <code>registration/verify.ftl</code> template from:</p>
<pre><code class="language-freemarker">[#if verificationId?? &amp;&amp; postMethod]
</code></pre>
<p dir="auto">To:</p>
<pre><code class="language-freemarker">[#if verificationId?? &amp;&amp; (postMethod!false)]
</code></pre>
<p dir="auto">The <code>!false</code> syntax provides a default value of <code>false</code> when <code>postMethod</code> is null or missing, preventing the FreeMarker exception.</p>
<p dir="auto"><strong>Steps to apply the fix:</strong></p>
<ol>
<li>Navigate to <strong>Customizations → Themes</strong> in the FusionAuth admin UI</li>
<li>Edit your theme</li>
<li>Locate the <code>registration/verify.ftl</code> template</li>
<li>Update the conditional check as shown above</li>
<li>Save the theme</li>
</ol>
<p dir="auto">This pattern can be applied to other templates where variables might be null or missing in certain execution paths.</p>
<p dir="auto"><strong>Why this happens:</strong></p>
<p dir="auto">According to the FusionAuth documentation, the <code>postMethod</code> variable is <strong>not</strong> a standard template-specific variable for the <code>/registration/verify</code> template. It is typically available on other verification templates like <code>/email/verify</code> (where it defaults to <code>true</code>). The registration verify template is rendered when a user clicks the URL from the verification email and the <code>verificationId</code> has expired or is invalid. In these scenarios, <code>postMethod</code> may not be set in the template context, which causes the FreeMarker error when attempting to evaluate it as a boolean.</p>
<h2>Related Documentation</h2>
<ul>
<li><a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/template-variables#verify-registration" rel="nofollow ugc">Theme Template Variables - Verify Registration</a> - Documents the variables available in the registration verify template</li>
<li><a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/template-variables#email-verification" rel="nofollow ugc">Theme Template Variables - Email Verification</a> - Shows that <code>postMethod</code> is documented for email verification but not registration verification</li>
<li><a href="https://fusionauth.io/docs/customize/look-and-feel/advanced-themes/template-variables" rel="nofollow ugc">Theme Template Variables</a> - Complete reference for all template variables across different templates</li>
</ul>
]]></description><link>https://fusionauth.io/community/forum/post/8853</link><guid isPermaLink="true">https://fusionauth.io/community/forum/post/8853</guid><dc:creator><![CDATA[FASupportBot]]></dc:creator><pubDate>Tue, 13 Oct 2026 19:03:19 GMT</pubDate></item></channel></rss>