<p>Sprout Email allows Craft Object Syntax for the object that is available when an event is triggered, in the same way you would use the Sections Title Format field.</p>

<p>If your form is submitting an Entry the dynamic object being submitted is an <code>EntryModel</code> and all values from that <code>EntryModel</code> will be available to several of your fields in Sprout Email. To access those values you can use one of two syntaxes:</p>

<ol>
<li>Shorthand Object Syntax</li>
</ol>

<p><code>{title}</code> or <code>{customFieldHandle}</code></p>

<ol start="2">
<li>Object Syntax</li>
</ol>

<p><code>{{ object.title }}</code> or <code>{{ object.customFieldHandle }}</code> - this longer form can also be used in more advanced twig constructs like <code>{% if object.title %}</code></p>

<p>Both of these syntaxes are comparable to how you would use <code>{{ entry.title }}</code> or <code>{{ entry.customFieldHandle }}</code> in your templates.</p>

<p>This is described with a few more examples on the <a href="https://sprout.barrelstrengthdesign.com/craft-plugins/email/docs/notifications/dynamic-values#using-dynamic-values-in-your-notification-entry-fields" rel="nofollow noreferrer">Dynamic Values page of the docs</a></p>

CC BY-SA 3.0
2017-03-20T15:18:25.277Z
Thanks for the reply. So to send the user that submitted the entry form (and is therefore the author) I should use `{author.email}` or `{object.author.email}` in the recipient field presumably?
shorn
CC BY-SA 3.0
2017-03-20T17:48:30.080Z
Close: `{author.email}` or `{{ object.author.email }}`. The shorthand syntax get's processed and wrapped with the double curlies and object variable prefix: `{author.email}` => `{{ object.* }}` where * is the value you provide `author.email`
Ben Parizek
CC BY-SA 3.0
2017-03-21T00:40:55.490Z
Just testing this out. The notification works from the CP, however, when I submit my form from the front end I get the following error
`Argument 1 passed to Craft\SproutEmail_NotificationEmailsService::relayNotificationThroughAssignedMailer() must be an instance of Craft\SproutEmail_NotificationEmailModel, null given, called in /Users/Me/Sites/MySite/craft/plugins/sproutemail/services/SproutEmail_NotificationEmailsService.php on line 442`
shorn
CC BY-SA 3.0
2017-03-21T01:54:37.657Z
@shorn - Sounds like this is a new issue and the immediate question above is addressed. To understand more info about your setup to help further, can you send us a support ticket with details about what versions of Craft and Sprout Email you are on and any relevant logs and template files that would be helpful to understand what you are doing. In addition, it would be good to see the settings you have prepared in your notification email and understand any other steps we would need to know about to recreate your issue. https://sprout.barrelstrengthdesign.com/craft-plugins/request/support
Ben Parizek
CC BY-SA 3.0
2017-03-27T22:20:01.540Z
Thanks Ben. Started again and seems to working following the above help. Thanks.
shorn
CC BY-SA 3.0
2017-03-20T15:04:30.497Z
2017-03-20T15:04:30.497Z
Ben Parizek
<p>I have a front end form for logged in users to submit new entries. I want that user to receive a notification (via Sprout Email) that there entry has been received (it's pending/disabled on submission).</p>

<p>I'm struggling with what my recipient variable should be!? </p>

<p>I should add, it's the logged in user that added the entry that I want to receive the notification.</p>

<emails><plugin-sproutemail>
Sprout email notifications - setting the recipient?
# Sprout email notifications - setting the recipient?

(Asked by: username_0 on 2017-03-18)

I have a front end form for logged in users to submit new entries. I want that user to receive a notification (via Sprout Email) that there entry has been received (it's pending/disabled on submission).

I'm struggling with what my recipient variable should be!?

I should add, it's the logged in user that added the entry that I want to receive the notification.

**Tags:** emails, plugin-sproutemail


---

## 1 answers

### Answer by username_1 on 2017-03-20. Score: 2 | Accepted answer

Sprout Email allows Craft Object Syntax for the object that is available when an event is triggered, in the same way you would use the Sections Title Format field.

If your form is submitting an Entry the dynamic object being submitted is an `EntryModel` and all values from that `EntryModel` will be available to several of your fields in Sprout Email. To access those values you can use one of two syntaxes:

1. Shorthand Object Syntax

`{title}` or `{customFieldHandle}`

2. Object Syntax

`{{ object.title }}` or `{{ object.customFieldHandle }}` - this longer form can also be used in more advanced twig constructs like `{% if object.title %}`

Both of these syntaxes are comparable to how you would use `{{ entry.title }}` or `{{ entry.customFieldHandle }}` in your templates.

This is described with a few more examples on the [Dynamic Values page of the docs](https://sprout.barrelstrengthdesign.com/craft-plugins/email/docs/notifications/dynamic-values#using-dynamic-values-in-your-notification-entry-fields)

> **Comments:**
> **username_0**: Thanks for the reply. So to send the user that submitted the entry form (and is therefore the author) I should use `{author.email}` or `{object.author.email}` in the recipient field presumably?  
> **username_1**: Close: `{author.email}` or `{{ object.author.email }}`. The shorthand syntax get's processed and wrapped with the double curlies and object variable prefix: `{author.email}` => `{{ object.* }}` where * is the value you provide `author.email`  
> **username_0**: Just testing this out. The notification works from the CP, however, when I submit my form from the front end I get the following error `Argument 1 passed to Craft\SproutEmail_NotificationEmailsService::relayNotificationThroughAssignedMailer() must be an instance of Craft\SproutEmail_NotificationEmailModel, null given, called in /Users/Me/Sites/MySite/craft/plugins/sproutemail/services/SproutEmail_NotificationEmailsService.php on line 442`  
> **username_1**: @username_0 - Sounds like this is a new issue and the immediate question above is addressed. To understand more info about your setup to help further, can you send us a support ticket with details about what versions of Craft and Sprout Email you are on and any relevant logs and template files that would be helpful to understand what you are doing. In addition, it would be good to see the settings you have prepared in your notification email and understand any other steps we would need to know about to recreate your issue. https://sprout.barrelstrengthdesign.com/craft-plugins/request/support  
> **username_0**: Thanks Ben. Started again and seems to working following the above help. Thanks.  

---

