Skip to content

Commit 62f49fd

Browse files
committed
Update README
1 parent 0c1301b commit 62f49fd

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
11
# Supermail
22

3-
Supermail is a slightly more intuitive way of organizing Emails in a Rails application.
3+
Organize emails with plain 'ol Ruby objects in a Rails application, like this:
4+
5+
```ruby
6+
# ./app/email/user/welcome.rb
7+
class User::WelcomeEmail < ApplicationEmail
8+
def initialize(person:)
9+
@person = person
10+
end
11+
12+
def to = @person.email
13+
def subject = "Welcome to Beautiful Ruby"
14+
def body
15+
super do
16+
<<~_
17+
Hi #{@person.name},
18+
19+
You're going to learn a ton at https://beautifulruby.com.
20+
_
21+
end
22+
end
23+
end
24+
```
25+
26+
Contrast that with rails ActionMailer, where you will spend 20 minutes trying to figure out how to send an email. I created this gem because I got tired of digging through Rails docs to understand how to intialize an email and send it. PORO's FTW!
427

528
## Installation
629

0 commit comments

Comments
 (0)