base_email_outbound.rb 875 B

12345678910111213141516171819202122232425262728
  1. # Copyright (C) 2012-2025 Zammad Foundation, https://zammad-foundation.org/
  2. class Channel::Driver::BaseEmailOutbound
  3. include Channel::EmailHelper
  4. def deliver(_options, _attr, _notification = false) # rubocop:disable Style/OptionalBooleanParameter
  5. raise 'not implemented'
  6. end
  7. def prepare_message_attrs(attr)
  8. # set system_bcc of config if defined
  9. system_bcc = Setting.get('system_bcc')
  10. email_address_validation = EmailAddressValidation.new(system_bcc)
  11. if system_bcc.present? && email_address_validation.valid?
  12. attr[:bcc] ||= ''
  13. attr[:bcc] += ', ' if attr[:bcc].present?
  14. attr[:bcc] += system_bcc
  15. end
  16. prepare_idn_outbound(attr)
  17. end
  18. def deliver_mail(attr, notification, method, options = {})
  19. mail = Channel::EmailBuild.build(attr, notification)
  20. mail.delivery_method method, options
  21. mail.deliver
  22. end
  23. end