Skip to content

LegionIO/lex-smtp

lex-smtp

SMTP email extension for LegionIO. Compose and deliver emails via SMTP from within task chains using Ruby's built-in Net::SMTP.

Installation

gem install lex-smtp

Or add to your Gemfile:

gem 'lex-smtp'

Usage

Send an email by triggering the email.send runner:

{
  "to": "recipient@example.com",
  "from": "sender@example.com",
  "subject": "Hello from Legion",
  "body": "Message body text",
  "address": "smtp.example.com",
  "port": 587
}

Runner

Runner Method Required Parameters
Email send to, from, subject, body

Optional: address (default: localhost), port (default: 25)

Standalone Client

Use lex-smtp as a standalone email client without the full Legion framework:

require 'legion/extensions/smtp/client'

client = Legion::Extensions::Smtp::Client.new(address: 'smtp.example.com', port: 587)
client.send(to: 'user@example.com', from: 'bot@example.com', subject: 'Hello', body: 'World')

Options passed to Client.new become defaults for all sends. You can override per-call via the send keyword arguments.

Requirements

  • Ruby >= 3.4
  • SMTP server
  • LegionIO framework (optional — standalone Client works without it)

License

MIT

About

No description or website provided.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE
MIT
LICENSE.txt

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors