<p>Yes.  You can use the value of your custom field <code>subject</code> in two ways:</p>

<p><strong>Shorthand Syntax:</strong></p>

<pre><code>{subject}
</code></pre>

<p><strong>Object Syntax</strong></p>

<pre><code>{{ object.subject }}
</code></pre>

<p>If you want to perform any conditional logic, you will need to use object syntax for the conditional logic:</p>

<pre><code>{% if object.subject != '' %}{{ object.subject }}{% else %}Fallback{% endif %}
</code></pre>

CC BY-SA 3.0
2016-04-18T18:39:56.137Z
2017-03-07T14:38:18.420Z
2017-03-07T14:38:18.420Z
Ben Parizek
<p>Is there a way to have a dynamic notification subject in Sprout Forms via custom fields, eg if I have a field called <code>subject</code> can I use this in the Subject option under Notifications as <code>{{ subject }}</code>?</p>

CC BY-SA 3.0
2016-04-18T16:17:49.330Z
Some progress - was using {{ subject }} when in fact should have been using { subject }. The next question is whether you can have conditional logic (eg `if subject then X otherwise Y`)
Cole Henley
<plugin-sproutforms>
Dynamic subject for form notification email
# Dynamic subject for form notification email

(Asked by: username_0 on 2016-04-18)

Is there a way to have a dynamic notification subject in Sprout Forms via custom fields, eg if I have a field called `subject` can I use this in the Subject option under Notifications as `{{ subject }}`?

**Tags:** plugin-sproutforms
> **Comments:**
> **username_0**: Some progress - was using {{ subject }} when in fact should have been using { subject }. The next question is whether you can have conditional logic (eg `if subject then X otherwise Y`)  

---

## 1 answers

### Answer by username_1 on 2016-04-18. Score: 2 | Accepted answer

Yes.  You can use the value of your custom field subject in two ways:
Shorthand Syntax:
{subject}

Object Syntax
{{ object.subject }}

If you want to perform any conditional logic, you will need to use object syntax for the conditional logic:
{% if object.subject != '' %}{{ object.subject }}{% else %}Fallback{% endif %}


---

