-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
78 additions
and
27 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
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
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,29 @@ | ||
require 'rails/generators' | ||
|
||
module Inky | ||
module Generators | ||
class InstallGenerator < ::Rails::Generators::Base | ||
desc 'Install Foundation for Emails' | ||
source_root File.join(File.dirname(__FILE__), 'templates') | ||
argument :layout_name, :type => :string, :default => 'inky_mailer', :banner => 'layout_name' | ||
|
||
def create_mailer_stylesheet | ||
template 'foundation_emails.scss', File.join(stylesheets_base_dir, 'foundation_emails.scss') | ||
end | ||
|
||
def create_mailer_layout | ||
template 'mailer_layout.html.erb', File.join(layouts_base_dir, "#{layout_name.underscore}.html.erb") | ||
end | ||
|
||
private | ||
|
||
def stylesheets_base_dir | ||
File.join('app', 'assets', 'stylesheets') | ||
end | ||
|
||
def layouts_base_dir | ||
File.join('app', 'views', 'layouts') | ||
end | ||
end | ||
end | ||
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 @@ | ||
@import "foundation-emails"; |
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,21 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
|
||
<%%= stylesheet_link_tag "foundation_emails" %> | ||
</head> | ||
|
||
<body> | ||
<table class="body" data-made-with-foundation> | ||
<tr> | ||
<td class="center" align="center" valign="top"> | ||
<center> | ||
<%%= yield %> | ||
</center> | ||
</td> | ||
</tr> | ||
</table> | ||
</body> | ||
</html> |