Oro\Bundle\EmailBundle\Entity\EmailTemplate:
    constraints:
        - Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity:
              fields:     [ name, entityName ]
              ignoreNull: false
        - Oro\Bundle\EmailBundle\Validator\Constraints\EmailTemplateSyntax: ~
    properties:
        name:
            - NotBlank:     ~
            - Length:
                min:        3
                max:        255
        type:
            - NotBlank:     ~
        organization:
            - NotBlank: ~

Oro\Bundle\EmailBundle\Form\Model\Email:
    constraints:
        - Oro\Bundle\EmailBundle\Validator\Constraints\EmailRecipients: ~
    properties:
        from:
            - NotBlank:     ~
            - Oro\Bundle\EmailBundle\Validator\Constraints\EmailAddress: ~
        to:
            - Oro\Bundle\EmailBundle\Validator\Constraints\EmailAddress: ~
        cc:
            - Oro\Bundle\EmailBundle\Validator\Constraints\EmailAddress: ~
        bcc:
            - Oro\Bundle\EmailBundle\Validator\Constraints\EmailAddress: ~
        subject:
            - NotBlank:     ~
        contexts:
            - Valid:
                traverse: false
