You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,29 @@
1
1
# Supermail
2
2
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
+
classUser::WelcomeEmail < ApplicationEmail
8
+
definitialize(person:)
9
+
@person= person
10
+
end
11
+
12
+
defto=@person.email
13
+
defsubject="Welcome to Beautiful Ruby"
14
+
defbody
15
+
superdo
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!
0 commit comments