name: 'Website feedback contact form'
description: 'Provides a website feedback contact form.'
type: 'Contact form'
install:
  - contact
input:
  recipient:
    data_type: email
    description: 'The email address that should receive submissions from the feedback form.'
    constraints:
      NotBlank: []
    prompt:
      method: ask
      arguments:
        question: 'What email address should receive website feedback?'
    default:
      source: config
      config: ['system.site', 'mail']
config:
  # Don't conflict with existing configuration.
  strict: false
  import:
    contact:
      - contact.form.personal
    system:
      - system.menu.footer
  actions:
    contact.form.feedback:
      createIfNotExists:
        label: 'Website feedback'
        message: 'Your message has been sent.'
        redirect: ''
      setRecipients:
        - ${recipient}
    core.menu.static_menu_link_overrides:
      simpleConfigUpdate:
        definitions.contact__site_page:
          menu_name: footer
          parent: ''
          weight: 0
          expanded: false
          enabled: true
    user.role.anonymous:
      grantPermission: 'access site-wide contact form'
    user.role.authenticated:
      grantPermission: 'access site-wide contact form'
