Skip to content

Instantly share code, notes, and snippets.

View coderberry's full-sized avatar

Eric Berry coderberry

View GitHub Profile
development:
...
test:
...
production:
website1:
domain: "[email protected]"
user_name: gary
class Website1 < ActionMailer::Base
def load_settings
options = YAML.load_file("#{RAILS_ROOT}/config/action_mailer.yml")[RAILS_ENV]["website1"]
@@smtp_settings = {
:address => options["address"],
:port => options["port"],
:domain => options["domain"],
:authentication => options["authentication"],
:user_name => options["user_name"],
:password => options["password"]
class Website2 < ActionMailer::Base
def load_settings
options = YAML.load_file("#{RAILS_ROOT}/config/action_mailer.yml")[RAILS_ENV]["website2"]
@@smtp_settings = {
:address => options["address"],
:port => options["port"],
:domain => options["domain"],
:authentication => options["authentication"],
:user_name => options["user_name"],
:password => options["password"]
# Found in code of controller
if session[:template_name] == "website1"
Website1.deliver_welcome_email("[email protected]")
else
Website2.deliver_welcome_email("[email protected]")
end
<html>
<head>
<style>
body {
background-color: #6e6e6e;
}
td.sheet_contents {
background-color: #fff;
padding: 2px;
# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def sheet(*args, &block)
code = <<-EOF
<table border="0" cellspacing="0" cellpadding="0" width="#{args[0]}">
<tr>
<td height="11" width="6"><img src="/images/shadow_tl.png" width="6" height="11" border="0" /></td>
<td rowspan="2" style="background-color: #fff; padding: 2px;">
<% sheet(500) do %>
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<% end %>
<img src="images/banner.jpg" border="0" />
<img src="{{assets_path}}banner.jpg" border="0" />
<meta name="keywords" content="{{meta_keywords}}"/>
<meta name="description" content="{{meta_description}}"/>