PrestaShop Developer Conference
PrestaShop Developer Conference
Paris, France - November 6, 2024
Let's talk code, commerce and open source.

EmailType

Symfony native EmailType extended with IDNConverter (InternationalizedDomainNameConverter) feature

  • Namespace: PrestaShopBundle\Form\Admin\Type
  • Reference: EmailType

Type options

Option Type Default value Description

Code example

$builder->add('email', EmailType::class, [
    'constraints' => [
        $this->getNotBlankConstraint(),
        $this->getLengthConstraint(EmployeeEmail::MAX_LENGTH),
        new Email([
            'message' => $this->trans('This field is invalid', [], 'Admin.Notifications.Error'),
        ]),
    ],
])

Preview example

EmailType rendered in form example