1

Sprout Forms 2.5.1 Sprout Email 3.0.3

I am getting the error "Internal Server Error - Illegal string offset 'template'"

I have updated the template file to use email variable instead of entry for the html and text content respectively.

Stack trace:

****************************************************************************************************** 2017/11/06 20:38:21 [error] [php] Illegal string offset 'template' (/home/forge/www.sitename.co.uk/craft/plugins/sproutemail/services/SproutEmailService.php:212) Stack trace: #0 /home/forge/www.sitename.co.uk/craft/plugins/sproutemail/services/SproutEmailService.php(69): Craft\SproutEmailService->error() #1 /home/forge/www.sitename.co.uk/craft/plugins/sproutemail/services/SproutEmailService.php(468): Craft\SproutEmailService->renderObjectTemplateSafely() #2 /home/forge/www.sitename.co.uk/craft/plugins/sproutemail/integrations/sproutemail/mailers/SproutEmail_DefaultMailer.php(99): Craft\SproutEmailService->renderEmailTemplates() #3 /home/forge/www.sitename.co.uk/craft/plugins/sproutemail/services/SproutEmail_NotificationEmailsService.php(487): Craft\SproutEmail_DefaultMailer->sendNotificationEmail() #4 /home/forge/www.sitename.co.uk/craft/plugins/sproutemail/services/SproutEmail_NotificationEmailsService.php(383): Craft\SproutEmail_NotificationEmailsService->relayNotificationThroughAssignedMailer() #5 /home/forge/www.sitename.co.uk/craft/plugins/sproutemail/services/SproutEmail_NotificationEmailsService.php(359): Craft\SproutEmail_NotificationEmailsService->handleDynamicEvent() #6 unknown(0): Craft\SproutEmail_NotificationEmailsService->Craft\{closure}() #7 /home/forge/www.sitename.co.uk/craft/plugins/sproutemail/services/SproutEmail_NotificationEmailsService.php(298): call_user_func_array() #8 /home/forge/www.sitename.co.uk/craft/app/framework/base/CComponent.php(567): Craft\SproutEmail_NotificationEmailsService->Craft\{closure}() #9 /home/forge/www.sitename.co.uk/craft/plugins/sproutforms/services/SproutFormsService.php(79): Craft\SproutFormsService->raiseEvent() #10 /home/forge/www.sitename.co.uk/craft/plugins/sproutforms/services/SproutForms_EntriesService.php(246): Craft\SproutFormsService->onSaveEntry() #11 /home/forge/www.sitename.co.uk/craft/plugins/sproutforms/services/SproutForms_EntriesService.php(195): Craft\SproutForms_EntriesService->callOnSaveEntryEvent() #12 /home/forge/www.sitename.co.uk/craft/plugins/sproutforms/controllers/SproutForms_EntriesController.php(162): Craft\SproutForms_EntriesService->saveEntry() #13 /home/forge/www.sitename.co.uk/craft/app/framework/web/actions/CInlineAction.php(49): Craft\SproutForms_EntriesController->actionSaveEntry() #14 /home/forge/www.sitename.co.uk/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams() #15 /home/forge/www.sitename.co.uk/craft/app/framework/web/CController.php(286): Craft\SproutForms_EntriesController->runAction() #16 /home/forge/www.sitename.co.uk/craft/app/framework/web/CController.php(265): Craft\SproutForms_EntriesController->runActionWithFilters() #17 /home/forge/www.sitename.co.uk/craft/app/framework/web/CWebApplication.php(282): Craft\SproutForms_EntriesController->run() #18 /home/forge/www.sitename.co.uk/craft/app/etc/web/WebApp.php(823): Craft\WebApp->runController() #19 /home/forge/www.sitename.co.uk/craft/app/etc/web/WebApp.php(287): Craft\WebApp->_processActionRequest() #20 /home/forge/www.sitename.co.uk/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest() #21 /home/forge/www.sitename.co.uk/craft/app/index.php(62): Craft\WebApp->run() #22 /home/forge/www.sitename.co.uk/public/index.php(19): require_once() REQUEST_URI=/contact-us

1

Although the Sprout Email docs state it is preferable to use shorthand syntax for variables in notifications, I found this to not be the case for the Notification subject line.

So using {companyName} in the subject would cause the issue shown above.

{{object.companyName}} fixes this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.