identifier: ContactForm
label: 'Formulaire de Contact'
prototypeName: standard
type: Form

renderingOptions:
  controllerAction: perform
  addQueryString: false
  submitButtonLabel: Envoyer

finishers:
  -
    identifier: EmailToReceiver
    options:
      subject: 'Informations request'
      senderAddress: ne-pas-repondre@opentalent.fr
      senderName: ''
      replyToRecipients:
        - ''
      carbonCopyRecipients:
        - ''
      blindCarbonCopyRecipients:
        - ''
      recipients: ''
      format: html
      attachUploads: true
      translation:
        language: default
  -
    identifier: EmailToSender
    options:
      subject: 'Your message has been posted'
      senderAddress: ne_pas_repondre@opentalent.fr
      senderName: ''
      replyToRecipients:
        - ''
      carbonCopyRecipients:
        - ''
      blindCarbonCopyRecipients:
        - ''
      recipients:
        '{email}': '{firstname} {lastname}'
      format: html
      attachUploads: 'false'
      templatePathAndFilename: 'EXT:ot_templating/Resources/Private/Templates/Forms/EmailToSender.html'
  -
    identifier: Confirmation
    options:
      message: 'Your message has been posted'
      contentElementUid: ''

renderables:
  -
    identifier: page
    label: ''
    type: Page

    renderingOptions:
      previousButtonLabel: 'LLL:EXT:ot_templating/Resources/Private/Language/locallang.xlf:form.previous'
      nextButtonLabel: 'LLL:EXT:ot_templating/Resources/Private/Language/locallang.xlf:form.next'

    renderables:
      -
        type: StaticText
        identifier: mandatory-fields-notice
        properties:
          text: 'Note: Fields marked with a star (*) are mandatory'
          elementClassAttribute: contact-form-info
        label: ''
      -
        type: GridRow
        identifier: row1
        label: ''
        renderables:
          -
            identifier: lastname
            label: Name
            type: Text
            defaultValue: ''
            properties:
              fluidAdditionalAttributes:
                required: required
            validators:
              -
               identifier: NotEmpty

          -
            identifier: firstname
            label: 'First name'
            type: Text
            defaultValue: ''
            properties:
              fluidAdditionalAttributes:
                required: required
            validators:
              -
                identifier: NotEmpty

      -
        identifier: email
        label: 'Email address'
        type: Text
        defaultValue: ''
        properties:
          fluidAdditionalAttributes:
            required: required
        validators:
          -
            identifier: EmailAddress
          -
            identifier: NotEmpty

      -
        type: GridRow
        identifier: row2
        label: ''
        renderables:

          -
            identifier: zipcode
            label: 'Zip code'
            type: Text
            defaultValue: ''
            validators:
              -
                identifier: Text

          -
            identifier: city
            label: City
            type: Text
            defaultValue: ''

          -
            identifier: phone
            label: Phone
            type: Text
            defaultValue: ''
      -
        identifier: subject
        label: Subject
        type: Text
        defaultValue: ''
        properties:
          fluidAdditionalAttributes:
            required: required
        validators:
          -
            identifier: NotEmpty
      -
        identifier: message
        label: Message
        type: Textarea
        defaultValue: ''
        properties:
          fluidAdditionalAttributes:
            placeholder: 'Your message here...'
            required: required
        validators:
          -
            identifier: NotEmpty
      -
        type: StaticText
        identifier: rgpd-notice
        properties:
          text: 'By submitting this form, you agree that theses informations can be processed in order to contact you back and answer your demand'
          elementClassAttribute: contact-form-info
        label: ''
      -
        validators:
          -
            identifier: Hcaptcha
        type: Hcaptcha
        identifier: hcaptcha-1
        label: hCaptcha
