CLI command to send transactional emails via SMTP with dry‑run support.
# Source: https://github.com/onetimesecret/onetimesecret | License: MIT | Copyright 2012-ongoing delano, contributors
# Provided via justclaw.it.com; keep this notice with the code.
# lib/onetime/cli/email/send_command.rb
#
# frozen_string_literal: true
# CLI command for sending transactional emails directly via SMTP.
#
# Usage:
# ots email send <template> --to user@example.com --data '{"key":"val"}'
# ots email send <template> --to user@example.com --data '{"key":"val"}' --execute
# ots email send <template> --to user@example.com --data '{"key":"val"}' --locale fr
#
# Dry-run by default. Use --execute to actually deliver.
# Bypasses RabbitMQ/workers — sends directly via configured SMTP backend.
require 'json'
# AVAILABLE_TEMPLATES must be defined before the option `desc:` below.
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key