Class: RubyLLM::Monitoring::Channels::Email

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_llm/monitoring/channels/email.rb

Class Method Summary collapse

Class Method Details

.deliver(message, config) ⇒ Object

Raises:

  • (ArgumentError)


5
6
7
8
9
10
11
12
13
14
# File 'lib/ruby_llm/monitoring/channels/email.rb', line 5

def self.deliver(message, config)
  raise ArgumentError, "Email requires :to" unless config[:to]

  RubyLLM::Monitoring::AlertMailer.with(
    to: config[:to],
    from: config[:from],
    subject: config[:subject] || "RubyLLM Monitoring Alert",
    body: message[:text]
  ).alert_notification.deliver_later
end