validate_configuration_outbound.rb 857 B

1234567891011121314151617
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. module Gql::Mutations
  3. class Channel::Email::ValidateConfigurationOutbound < Channel::Email::BaseConfiguration
  4. description 'Validate an outbound email channel configuration by sending a test email'
  5. argument :outbound_configuration, Gql::Types::Input::Channel::Email::OutboundConfigurationInputType, description: 'Configuration to validate'
  6. argument :email_address, String, description: 'Sender and recipient of verify email'
  7. field :success, Boolean, null: false, description: 'Was the validation successful?'
  8. def resolve(outbound_configuration:, email_address:)
  9. internal_result = EmailHelper::Probe.outbound(map_type_to_config(outbound_configuration), email_address)
  10. map_probe_result(internal_result, field_prefix: :outbound)
  11. end
  12. end
  13. end