Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Email without all that unnecessary junk. It's simple!
- Loading branch information
Jeff Keen
committed
Mar 31, 2010
0 parents
commit 5a2cc8c
Showing
5 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'rubygems' | ||
require 'sinatra' | ||
|
||
set :run, false | ||
set :environment, ENV['RACK_ENV'] | ||
|
||
require 'simple' | ||
run Sinatra::Application |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
body { | ||
font-family:Helvetica, Arial, sans-serif; | ||
text-align:center; | ||
padding:5em 2em 2em; | ||
} | ||
h1 { | ||
font-size:3em; | ||
padding-bottom:0.3em; | ||
} | ||
h1 a { | ||
color:#EEE; | ||
text-decoration:none; | ||
} | ||
h1 a:hover { | ||
color:#DDD; | ||
} | ||
h3 { | ||
font-size:3em; | ||
padding:0; | ||
margin-bottom:0.6em; | ||
} | ||
label { | ||
font-size:2.0em; | ||
color:#333; | ||
position:relative; | ||
left:-0.5em; | ||
} | ||
input[type=email] { | ||
font-size:1.0em; | ||
padding:10px; | ||
} | ||
input[type=submit] { | ||
font-size:1.5em; | ||
background-color:#ECECEA; | ||
color:#333; | ||
padding:2px 5px; | ||
border-radius:5px; | ||
-moz-border-radius:5px; | ||
-webkit-border-radius:5px; | ||
} | ||
p { | ||
height:4.2em; | ||
position:relative; | ||
} | ||
|
||
form.error input[type=email] { | ||
border:2px solid red; | ||
} | ||
|
||
form.error span { | ||
font-size:1em; | ||
font-weight:normal; | ||
position:absolute; | ||
top:1.5em; | ||
font-style:italic; | ||
color:red; | ||
} | ||
|
||
footer, footer a { | ||
color:#EEE; | ||
} | ||
footer a:hover { | ||
color:#CCC; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require 'rubygems' | ||
require 'sinatra' | ||
require 'erb' | ||
require 'action_mailer' | ||
|
||
helpers do | ||
include Rack::Utils | ||
end | ||
|
||
get '/' do | ||
erb :index | ||
end | ||
|
||
get '/send' | ||
redirect '/' | ||
end | ||
|
||
post '/send' do | ||
if params[:email] =~ /@/ | ||
@success = true; | ||
else | ||
@errors = "<span>Invalid email address</span>" | ||
end | ||
erb :index | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | ||
<title>Simple Email</title> | ||
<link rel="stylesheet" href="/css/master.css" type="text/css" media="screen" charset="utf-8"> | ||
</head> | ||
<body> | ||
<% if @success %> | ||
<h3>Sent! So simple!</h3> | ||
<% else %> | ||
|
||
<h1><a href="/">Simple Email</a></h1> | ||
|
||
<form action="send" method="post" accept-charset="utf-8" class="<%= "error" if @errors %>"> | ||
<p> | ||
<!-- From: Unnecessary. It's always you. --> | ||
|
||
<label>To: | ||
<input type="email" name="email"/> | ||
</label> | ||
<%= @errors %> | ||
|
||
<!-- Subject: "News", "Hi", <no subject>. Pointless. Take it out. --> | ||
<!-- Body: I'm not writing bloated software here. This email system is simple. --> | ||
|
||
<!-- Submit button: Unncessary. C'mon people. Hit return. --> | ||
</p> | ||
</form> | ||
<% end %> | ||
<footer> | ||
<p> | ||
<!-- Very necessary. I'm hoping to crack the 5-subscriber glass ceiling. --> | ||
© 2010 <a href="http://keen.me">keen.me</a> | <a href="http://twitter.com/jeffxl">@jeffxl</a> | ||
</p> | ||
</footer> | ||
</body> | ||
</html> |