# Custom builder help

**URL:** <https://forum.mautic.org/t/custom-builder-help/22971>\
**Category:** Development\
**Created:** [March 9, 2022, 2:08pm UTC](https://forum.mautic.org/t/custom-builder-help/22971 "2022-03-09T14:08:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![NichMaia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nichmaia/32/6488_2.png) [@NichMaia](https://forum.mautic.org/u/NichMaia)\
**Post date:** [March 9, 2022, 2:08pm UTC](https://forum.mautic.org/t/custom-builder-help/22971/1 "2022-03-09T14:08:34Z")

</div>

Hi, I’ve been trying to make a new custom builder plugin based on [GitHub - enguerr/MauticBeefreeBundle: FreeBee.io plugin editor for mautic](https://github.com/enguerr/MauticBeefreeBundle), since that one is not working with the current versions of mautic, but am having a lot of problems with it.

My current issue is the error “Could not load type “builder\_section”: class does not exist.”

I believe the problem is in the following section:

```auto
...
$sectionForm = $this->get('form.factory')->create('builder_section');
...
return $this->delegateView(
            [
                'viewParameters' => [
                    'form' => $this->setFormTheme($form, 'MauticEmailBundle:Email:form.html.php', 'MauticEmailBundle:FormTheme\Email'),
                    'isVariant' => $entity->isVariant(true),
                    'slots' => $this->buildSlotForms($slotTypes),
                    'sections' => $this->buildSlotForms($sections),
                    'themes' => $this->factory->getInstalledThemes('email', true),
                    'bfthemes' => $bfrepo->getInstalledThemes('email', true),
                    'version' => $lastversion,
                    'version_post' => $postversion,
                    'email' => $entity,
                    'forceTypeSelection' => $forceTypeSelection,
                    'attachmentSize' => $attachmentSize,
                    'builderAssets' => trim(preg_replace('/\s+/', ' ', $this->getAssetsForBuilder())), // strip new lines
                    'sectionForm' => $sectionForm->createView(),
                    'permissions' => $permissions,
                    'previewUrl' => $this->generateUrl(
                        'mautic_email_preview',
                        ['objectId' => $entity->getId()],
                        true
                    ),
                ],
                'contentTemplate' => 'MauticBeefreeBundle:Email:form.html.php',
                'passthroughVars' => [
                    'activeLink' => '#mautic_email_index',
                    'mauticContent' => 'email',
                    'updateSelect' => InputHelper::clean($this->request->query->get('updateSelect')),
                    'route' => $this->generateUrl('mautic_email_action', $routeParams),
                    'validationError' => $this->getFormErrorForBuilder($form),
                ],
            ]
        );

```

Can someone assist me with this? I’m using Mautic 4.1.1, if that helps with anything

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 9, 2022, 2:40pm UTC](https://forum.mautic.org/t/custom-builder-help/22971/2 "2022-03-09T14:40:36Z")

</div>

I wonder if the underlaying template has to be compatible with the new builder.  
In the config files of templates we always have to list the builder it’s compatible with.

---

<div class="post-metadata">

**Author:** ![NichMaia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nichmaia/32/6488_2.png) [@NichMaia](https://forum.mautic.org/u/NichMaia)\
**Post date:** [March 9, 2022, 2:48pm UTC](https://forum.mautic.org/t/custom-builder-help/22971/3 "2022-03-09T14:48:23Z")

</div>

Maybe, the problem is when clicking the “new” button in the email page

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5cf869c82a1a19de38de18ccea6664d4d785fe03.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [March 9, 2022, 3:34pm UTC](https://forum.mautic.org/t/custom-builder-help/22971/4 "2022-03-09T15:34:03Z")

</div>

Each email you create in Mautic needs to have a compatible template - I can see you have none.  
Copy one of the html templates (maybe the blank one) and add to the config:  
yourbuildername has to be added otherwise the template cannot show

```auto
{
  "name": "Great Theme",
  "author": "Mr. Robot",
  "authorUrl": "https://mautic.org",
  "builder": ["yourbuildername"],
  "features": [
    "email"
  ]
}

```

Read more:

> **[Creating a theme](https://docs.mautic.org/en/builders/%20creating%20a%20theme)**
>
> MJML enables marketers to easily create and maintain beautiful and responsive themes for Mautic.Why use email themes?. Purpose of a theme. The GrapesJs builder makes it possible to insert HTML code and edit it in a 'What You See Is What You Get'...

---

<div class="post-metadata">

**Author:** ![NichMaia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nichmaia/32/6488_2.png) [@NichMaia](https://forum.mautic.org/u/NichMaia)\
**Post date:** [March 9, 2022, 3:53pm UTC](https://forum.mautic.org/t/custom-builder-help/22971/5 "2022-03-09T15:53:24Z")

</div>

Just did as instructed, cleaned the cache, and still the same error, nothing changed there.

The error log shows this:

```auto
[2022-03-09 15:47:56] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Form\Exception\InvalidArgumentException: "Could not load type "builder_section": class does not exist." at C:\xampp\htdocs\mautic\vendor\symfony\form\FormRegistry.php line 83 {"exception":"[object] (Symfony\\Component\\Form\\Exception\\InvalidArgumentException(code: 0): Could not load type \"builder_section\": class does not exist. at C:\\xampp\\htdocs\\mautic\\vendor\\symfony\\form\\FormRegistry.php:83)
[stacktrace]
#0 C:\\xampp\\htdocs\\mautic\\vendor\\symfony\\form\\FormFactory.php(60): Symfony\\Component\\Form\\FormRegistry->getType('builder_section')
#1 C:\\xampp\\htdocs\\mautic\\vendor\\symfony\\form\\FormFactory.php(32): Symfony\\Component\\Form\\FormFactory->createBuilder('builder_section', NULL, Array)
#2 C:\\xampp\\htdocs\\mautic\\plugins\\MauticBeefreeBundle\\Controller\\MauticBeefreeEmailController.php(378): Symfony\\Component\\Form\\FormFactory->create('builder_section')

```

---

<div class="post-metadata">

**Author:** ![NichMaia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nichmaia/32/6488_2.png) [@NichMaia](https://forum.mautic.org/u/NichMaia)\
**Post date:** [March 10, 2022, 12:58pm UTC](https://forum.mautic.org/t/custom-builder-help/22971/6 "2022-03-10T12:58:37Z")

</div>

To fix this, I used  
`$sectionForm = $this->get('form.factory')->create(BuilderSectionType::class);`

Now my only issue is getting it to save the template

---

<div class="post-metadata">

**Author:** ![seti](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/seti/32/6477_2.png) [@seti](https://forum.mautic.org/u/seti)\
**Post date:** [March 11, 2022, 11:20am UTC](https://forum.mautic.org/t/custom-builder-help/22971/7 "2022-03-11T11:20:13Z")

</div>

Hi NichMaia, do you plan to share your plugin? I’ve been using engerr’s plugin and I really love it.
