1

I'm trying to get contact-form plugin working.

When I add the default script and send the form I get this error:

enter image description here

craft\web\twig\TemplateLoaderException: The template «» couldn't be found. in /vendor/craftcms/cms/src/web/twig/TemplateLoader.php:116
Stack trace:
#0 /vendor/craftcms/cms/src/web/twig/TemplateLoader.php(72): craft\web\twig\TemplateLoader->_resolveTemplate('')
#1 /vendor/twig/twig/src/Environment.php(299): craft\web\twig\TemplateLoader->getCacheKey('')
#2 /vendor/twig/twig/src/Environment.php(381): Twig\Environment->getTemplateClass('')
#3 /vendor/craftcms/cms/src/web/twig/Environment.php(41): Twig\Environment->loadTemplate('', NULL)
#4 /vendor/twig/twig/src/Environment.php(359): craft\web\twig\Environment->loadTemplate('')
#5 /vendor/twig/twig/src/Environment.php(318): Twig\Environment->load('')
#6 /vendor/craftcms/cms/src/web/View.php(408): Twig\Environment->render('', Array)
#7 /vendor/hybridinteractive/craft-contact-form-extensions/src/ContactFormExtensions.php(157): craft\web\View->renderTemplate('', Array)
#8 [internal function]: hybridinteractive\contactformextensions\ContactFormExtensions->hybridinteractive\contactformextensions\{closure}(Object(craft\contactform\events\SendEvent))
#9 /vendor/yiisoft/yii2/base/Event.php(312): call_user_func(Object(Closure), Object(craft\contactform\events\SendEvent))
#10 /vendor/yiisoft/yii2/base/Component.php(642): yii\base\Event::trigger('craft\\contactfo...', 'beforeSend', Object(craft\contactform\events\SendEvent))
#11 /vendor/craftcms/contact-form/src/Mailer.php(102): yii\base\Component->trigger('beforeSend', Object(craft\contactform\events\SendEvent))
#12 /vendor/craftcms/contact-form/src/controllers/SendController.php(54): craft\contactform\Mailer->send(Object(craft\contactform\models\Submission))
#13 [internal function]: craft\contactform\controllers\SendController->actionIndex()
#14 /vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#15 /vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#16 /vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('', Array)
#17 /vendor/craftcms/cms/src/web/Application.php(293): yii\base\Module->runAction('contact-form/se...', Array)
#18 /vendor/craftcms/cms/src/web/Application.php(602): craft\web\Application->runAction('contact-form/se...', Array)
#19 /vendor/craftcms/cms/src/web/Application.php(272): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#20 /vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#21 /www/index.php(32): yii\base\Application->run()
#22 {main}

I use the regular unaltered script from the rpo:

<form method="post" action="" accept-charset="UTF-8">
    {{ csrfInput() }}
    {{ actionInput('contact-form/send') }}
    {{ redirectInput('contact/thanks') }}

what seems to be the issue here?

Craft: 3.7.63.1 php: 8.1.1

1 Answer 1

1

Somewhere, somehow, you are trying to call a template named «». That obviously doesn't exist.

Which means you need to track down what is trying to call that "template". It's very hard to say from here, the example form code that you included would not trigger that error on its own.

In your stack trace, on line #7, it seems that the hybridinteractive/craft-contact-form-extensions plugin is getting involved. Poke around the settings for that plugin, perhaps you'll find something.

2
  • 1
    YES. I found the issue. In the aforementioned craft-contact-form-extensions Plugin there needs to be a email template path specified, which I overlooked. Specifying a template solves the error. Thanks for pointing it out.
    – KSPR
    Commented Jan 23, 2023 at 10:50
  • 1
    Hi there! If you run into any other issues please feel free to create an issue on GitHub here github.com/hybridinteractive/craft-contact-form-extensions/… and we'll be able to help you more there. Thanks for using our plugin and best of luck... Commented Jan 23, 2023 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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