Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add object (asset) to the email template body #90

Open
masiorama opened this issue Jul 23, 2017 · 0 comments
Open

Unable to add object (asset) to the email template body #90

masiorama opened this issue Jul 23, 2017 · 0 comments

Comments

@masiorama
Copy link

masiorama commented Jul 23, 2017

Edit: the main problem is that I cannot figure out how to add an object to the template email as with object notation (in example {{fileUpload.url}}), which is my case since my form is dealing with assets.

As I try to embed the asset filed inside the email content (as a download link), with the placeholder {fileUploaded}, or {fileUploaded.url} or {{fileUpload.url}} the system returns this error:

`PHP Error [500]

Object of class Craft\ElementCriteriaModel could not be converted to string (/var/www/html/planetwellness/craft/storage/runtime/compiled_templates/65/650b3c7530bd5c8ceb760a1ff99c2c47856f3c94603bce9c4ce87ef1e25edfc0.php:47)

/var/www/html/planetwellness/craft/app/etc/errors/ErrorHandler.php(184): Craft\ErrorHandler->handleError()
 /var/www/html/planetwellness/craft/app/framework/base/CErrorHandler.php(133): Craft\ErrorHandler->handleError()
 /var/www/html/planetwellness/craft/app/framework/base/CApplication.php(834): Craft\ErrorHandler->handle()
 /var/www/html/planetwellness/craft/app/etc/web/WebApp.php(685): Craft\WebApp->handleError()
 /var/www/html/planetwellness/craft/storage/runtime/compiled_templates/65/650b3c7530bd5c8ceb760a1ff99c2c47856f3c94603bce9c4ce87ef1e25edfc0.php(47): Craft\WebApp->handleError()
 /var/www/html/planetwellness/craft/app/vendor/twig/twig/lib/Twig/Template.php(381): __TwigTemplate_3fffb52b0336143610b287ba8709a78093c219b7c89bb1354b27393a098bb176->doDisplay()
 /var/www/html/planetwellness/craft/app/etc/templating/BaseTemplate.php(26): __TwigTemplate_3fffb52b0336143610b287ba8709a78093c219b7c89bb1354b27393a098bb176->displayWithErrorHandling()
 /var/www/html/planetwellness/craft/app/vendor/twig/twig/lib/Twig/Template.php(355): __TwigTemplate_3fffb52b0336143610b287ba8709a78093c219b7c89bb1354b27393a098bb176->displayWithErrorHandling()
 /var/www/html/planetwellness/craft/app/vendor/twig/twig/lib/Twig/Template.php(366): __TwigTemplate_3fffb52b0336143610b287ba8709a78093c219b7c89bb1354b27393a098bb176->display()
 /var/www/html/planetwellness/craft/app/services/TemplatesService.php(339): __TwigTemplate_3fffb52b0336143610b287ba8709a78093c219b7c89bb1354b27393a098bb176->render()
 /var/www/html/planetwellness/craft/plugins/formerly/services/Formerly_SubmissionsService.php(271): Craft\TemplatesService->renderObjectTemplate()
 /var/www/html/planetwellness/craft/plugins/formerly/services/Formerly_SubmissionsService.php(208): Craft\Formerly_SubmissionsService->_renderSubmissionTemplate()
 /var/www/html/planetwellness/craft/plugins/formerly/services/Formerly_SubmissionsService.php(33): Craft\Formerly_SubmissionsService->sendSubmissionEmails()
 /var/www/html/planetwellness/craft/plugins/formerly/controllers/Formerly_SubmissionsController.php(124): Craft\Formerly_SubmissionsService->postSubmission()
/var/www/html/planetwellness/craft/app/framework/web/actions/CInlineAction.php(49): Craft\Formerly_SubmissionsController->actionPostSubmission()
 /var/www/html/planetwellness/craft/app/framework/web/CController.php(308): CInlineAction->runWithParams()
 /var/www/html/planetwellness/craft/app/framework/web/CController.php(286): Craft\Formerly_SubmissionsController->runAction()
 /var/www/html/planetwellness/craft/app/framework/web/CController.php(265): Craft\Formerly_SubmissionsController->runActionWithFilters()
 /var/www/html/planetwellness/craft/app/framework/web/CWebApplication.php(282): Craft\Formerly_SubmissionsController->run()
 /var/www/html/planetwellness/craft/app/etc/web/WebApp.php(815): Craft\WebApp->runController()
 /var/www/html/planetwellness/craft/app/etc/web/WebApp.php(285): Craft\WebApp->_processActionRequest()
/var/www/html/planetwellness/craft/app/framework/base/CApplication.php(185): Craft\WebApp->processRequest()
 /var/www/html/planetwellness/craft/app/index.php(62): Craft\WebApp->run()
 /var/www/html/planetwellness/index.php(19): require_once()`
@masiorama masiorama changed the title error while sending email with asset link inside email content Unable to add object (asset) to the email template body Jul 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant