Skip to content

Instantly share code, notes, and snippets.

View Antiarchitect's full-sized avatar
💭
Single

Andrey Voronkov Antiarchitect

💭
Single
View GitHub Profile
@Antiarchitect
Antiarchitect / gist:143e40aaae463486bfc52b8bbf79e9d3
Last active July 3, 2018 09:44 — forked from barelyknown/gist:3692433
Send Email From Rails Console
# Simple approach to sending email from the Rails console
# Implementation idea courtesy of Steve Klabnik
# http://blog.steveklabnik.com/posts/2012-09-09-random-ruby-tricks--class-new
# Create the mailer class with a block and assign to a variable
mailer = Class.new(ActionMailer::Base) do
def example_message
mail(to: "voronkovaa@gmail.com", from: "noreply@polarstern-staging.de", subject: "Example Message") do |format|
format.text { render text: "Example message body" }
end