<p>This error can be triggered when you try to use a variable name in your Sprout Email template or fields that is not present in the submitted Form data.</p>

<p>One example where this can occur is if you try to reuse the example Welcome Notification email provided in Sprout Email and don't update the <code>{email}</code> or <code>{username}</code> values in the HTML and Text body fields.</p>

<p>I'll add it to our list to revisit the error thrown here, as it's not clear at all what is happening from the error provided in the message you received above.</p>

CC BY-SA 3.0
2016-08-19T14:22:27.167Z
Interestingly enough, neither template references any values passed by the form at the minute, I was waiting to implement that later.
awittyusername
CC BY-SA 3.0
2016-08-19T14:27:22.967Z
Alright, I may need you to send over your db and any email templates you are referencing to support then: http://sprout.barrelstrengthdesign.com/craft-plugins/request/suppor‌​t
Ben Parizek
CC BY-SA 3.0
2016-08-19T14:31:04.367Z
I'm not sure if I can do, as it may contain sensitive information. I'll check with my manager and then may open a support ticket. Thank you for your help!
awittyusername
CC BY-SA 3.0
2016-08-19T16:33:59.330Z
Understood. If you can just send your Sprout Forms and Sprout Fields tables, that may be enough.
Ben Parizek
CC BY-SA 3.0
2016-08-19T14:18:20.057Z
2016-08-19T14:18:20.057Z
Ben Parizek
<p>I've only recently started using Craft, so please excuse me if this is an obvious or silly question, but I've run into this problem when trying to create notifications on Sprout Emails (triggered by a Sprout Form).</p>

<p>The error is as follows:</p>

<pre><code>PHP warning

Creating default object from empty value

/var/www/craft/plugins/sproutemail/services/SproutEmailService.php(506)

...
505         // Add a few additional variables to our info table
506         $event-&gt;params['variables']['info']-&gt;deliveryStatus = $deliveryStatus;
507         $event-&gt;params['variables']['info']-&gt;message        = $message;
...
</code></pre>

<p>I'm really not sure how to fix this - each form worked perfectly before, and it's only since I started using Sprout Email twenty minutes ago!</p>

<p>If I've not included enough code please tell me and I can include more!</p>

<p>Thank you</p>

CC BY-SA 3.0
2016-08-19T13:52:12.417Z
Can you confirm which versions of Sprout Forms, Sprout Email and Craft you are using and ensure they are the latest?  If so, we may need you to drop us a note to support with a db dump to help take a closer look at what's going on: http://sprout.barrelstrengthdesign.com/craft-plugins/request/support
Ben Parizek
CC BY-SA 3.0
2016-08-19T13:57:52.893Z
Craft CMS 2.6.2797, Sprout Email 2.3.0, Sprout Forms 2.3.2 is what I am working with, is this right?
awittyusername
<plugin-sproutforms><plugin-sproutemail>
Creating default object from empty value - Sprout Email
# Creating default object from empty value - Sprout Email

(Asked by: username_0 on 2016-08-19)

I've only recently started using Craft, so please excuse me if this is an obvious or silly question, but I've run into this problem when trying to create notifications on Sprout Emails (triggered by a Sprout Form).
The error is as follows:
PHP warning

Creating default object from empty value

/var/www/craft/plugins/sproutemail/services/SproutEmailService.php(506)

...
505         // Add a few additional variables to our info table
506         $event->params['variables']['info']->deliveryStatus = $deliveryStatus;
507         $event->params['variables']['info']->message        = $message;
...

I'm really not sure how to fix this - each form worked perfectly before, and it's only since I started using Sprout Email twenty minutes ago!
If I've not included enough code please tell me and I can include more!
Thank you

**Tags:** plugin-sproutforms, plugin-sproutemail

> **Comments:**
> **username_1**: Can you confirm which versions of Sprout Forms, Sprout Email and Craft you are using and ensure they are the latest?  If so, we may need you to drop us a note to support with a db dump to help take a closer look at what's going on: http://sprout.barrelstrengthdesign.com/craft-plugins/request/support  
> **username_0**: Craft CMS 2.6.2797, Sprout Email 2.3.0, Sprout Forms 2.3.2 is what I am working with, is this right?  

---

## 1 answers

### Answer by username_1 on 2016-08-19. Score: 2

This error can be triggered when you try to use a variable name in your Sprout Email template or fields that is not present in the submitted Form data.

One example where this can occur is if you try to reuse the example Welcome Notification email provided in Sprout Email and don't update the `{email}` or `{username}` values in the HTML and Text body fields.

I'll add it to our list to revisit the error thrown here, as it's not clear at all what is happening from the error provided in the message you received above.

> **Comments:**
> **username_0**: Interestingly enough, neither template references any values passed by the form at the minute, I was waiting to implement that later.  
> **username_1**: Alright, I may need you to send over your db and any email templates you are referencing to support then: http://sprout.barrelstrengthdesign.com/craft-plugins/request/suppor‌​t  
> **username_0**: I'm not sure if I can do, as it may contain sensitive information. I'll check with my manager and then may open a support ticket. Thank you for your help!  
> **username_1**: Understood. If you can just send your Sprout Forms and Sprout Fields tables, that may be enough.  

---

