Open
Conversation
|
This looks like a useful action to have. To verify this manually, here's a suggested approach:
Example test script (replace with your actual settings): require_relative 'Email/email_send_action'
# Configure Sublayer logger (replace with your actual configuration)
class Sublayer
class Configuration
attr_accessor :logger
end
def self.configuration
@configuration ||= Configuration.new
end
end
class Logger
def log(level, message)
puts "[#{level}] #{message}"
end
end
Sublayer.configuration.logger = Logger.new
smtp_settings = {
address: 'smtp.gmail.com',
port: 587,
domain: 'gmail.com',
user_name: 'your_test_email@gmail.com',
password: 'your_password',
authentication: 'plain',
enable_starttls_auto: true
}
from = 'your_test_email@gmail.com'
to = 'recipient_email@example.com'
subject = 'Test Email from EmailSendAction'
body = 'This is a test email.'
action = EmailSendAction.new(smtp_settings: smtp_settings, from: from, to: to, subject: subject, body: body)
begin
result = action.call
puts "Email sent successfully: #{result}" if result
rescue StandardError => e
puts "Error: #{e.message}"
endSecurity Considerations:
By following these steps, you can ensure the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sends an email via a specified email provider like Gmail or Outlook. Useful for sending alerts or notifications from AI processes.