alchemy_crm 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/Gemfile +10 -11
  2. data/alchemy_crm.gemspec +21 -21
  3. data/app/assets/javascripts/alchemy_crm/alchemy_crm.base.js +54 -54
  4. data/app/assets/stylesheets/alchemy_crm/base.css.scss +199 -199
  5. data/app/controllers/alchemy_crm/admin/base_controller.rb +5 -5
  6. data/app/controllers/alchemy_crm/admin/contact_groups_controller.rb +15 -15
  7. data/app/controllers/alchemy_crm/admin/contacts_controller.rb +95 -95
  8. data/app/controllers/alchemy_crm/admin/deliveries_controller.rb +66 -66
  9. data/app/controllers/alchemy_crm/admin/elements_controller_extension.rb +23 -23
  10. data/app/controllers/alchemy_crm/admin/mailings_controller.rb +44 -44
  11. data/app/controllers/alchemy_crm/admin/newsletters_controller.rb +16 -16
  12. data/app/controllers/alchemy_crm/admin/tags_controller.rb +60 -59
  13. data/app/controllers/alchemy_crm/base_controller.rb +3 -3
  14. data/app/controllers/alchemy_crm/contacts_controller.rb +88 -88
  15. data/app/controllers/alchemy_crm/mailings_controller.rb +16 -16
  16. data/app/controllers/alchemy_crm/recipients_controller.rb +30 -30
  17. data/app/controllers/alchemy_crm/subscriptions_controller.rb +54 -54
  18. data/app/helpers/alchemy/pages_helper_extension.rb +14 -14
  19. data/app/helpers/alchemy_crm/admin/base_helper.rb +8 -8
  20. data/app/helpers/alchemy_crm/mailings_helper.rb +175 -175
  21. data/app/mailers/alchemy_crm/bounce_receiver.rb +9 -9
  22. data/app/mailers/alchemy_crm/contacts_mailer.rb +21 -21
  23. data/app/mailers/alchemy_crm/mailings_mailer.rb +46 -46
  24. data/app/mailers/alchemy_crm/subscriptions_mailer.rb +12 -12
  25. data/app/models/alchemy/essence_element_teaser.rb +14 -14
  26. data/app/models/alchemy_crm/contact.rb +260 -260
  27. data/app/models/alchemy_crm/contact_group.rb +15 -15
  28. data/app/models/alchemy_crm/contact_group_filter.rb +17 -17
  29. data/app/models/alchemy_crm/delivery.rb +54 -54
  30. data/app/models/alchemy_crm/element_extension.rb +23 -23
  31. data/app/models/alchemy_crm/mailing.rb +90 -90
  32. data/app/models/alchemy_crm/newsletter.rb +33 -33
  33. data/app/models/alchemy_crm/reaction.rb +5 -5
  34. data/app/models/alchemy_crm/recipient.rb +46 -46
  35. data/app/models/alchemy_crm/subscription.rb +4 -4
  36. data/app/views/alchemy/admin/elements/fill.js.erb +11 -11
  37. data/app/views/alchemy/elements/_newsletter_article_view.html.erb +14 -14
  38. data/app/views/alchemy/elements/_newsletter_greeting_view.html.erb +9 -9
  39. data/app/views/alchemy/elements/_newsletter_signout_form_view.html.erb +18 -18
  40. data/app/views/alchemy/elements/_newsletter_signup_form_view.html.erb +62 -62
  41. data/app/views/alchemy/essences/_essence_element_teaser_editor.html.erb +29 -29
  42. data/app/views/alchemy/newsletter_layouts/_standard.html.erb +37 -37
  43. data/app/views/alchemy_crm/admin/contact_groups/_contact_group.html.erb +30 -30
  44. data/app/views/alchemy_crm/admin/contact_groups/_filter.html.erb +28 -28
  45. data/app/views/alchemy_crm/admin/contact_groups/_form.html.erb +45 -45
  46. data/app/views/alchemy_crm/admin/contact_groups/_tag.html.erb +4 -4
  47. data/app/views/alchemy_crm/admin/contact_groups/add_filter.js.erb +7 -7
  48. data/app/views/alchemy_crm/admin/contact_groups/index.html.erb +28 -28
  49. data/app/views/alchemy_crm/admin/contacts/_contact.html.erb +42 -42
  50. data/app/views/alchemy_crm/admin/contacts/_form.html.erb +76 -76
  51. data/app/views/alchemy_crm/admin/contacts/import.html.erb +27 -27
  52. data/app/views/alchemy_crm/admin/contacts/index.html.erb +39 -39
  53. data/app/views/alchemy_crm/admin/contacts/vcf_import_result.html.erb +24 -24
  54. data/app/views/alchemy_crm/admin/deliveries/_delivery.html.erb +30 -30
  55. data/app/views/alchemy_crm/admin/deliveries/_form.html.erb +61 -61
  56. data/app/views/alchemy_crm/admin/deliveries/_recipient.html.erb +36 -36
  57. data/app/views/alchemy_crm/admin/deliveries/index.html.erb +21 -21
  58. data/app/views/alchemy_crm/admin/deliveries/show.html.erb +61 -61
  59. data/app/views/alchemy_crm/admin/elements/teasables.html.erb +53 -53
  60. data/app/views/alchemy_crm/admin/mailings/_form.html.erb +41 -41
  61. data/app/views/alchemy_crm/admin/mailings/_mailing.html.erb +73 -73
  62. data/app/views/alchemy_crm/admin/mailings/edit_content.html.erb +170 -170
  63. data/app/views/alchemy_crm/admin/mailings/import_result.html.erb +18 -18
  64. data/app/views/alchemy_crm/admin/mailings/index.html.erb +25 -25
  65. data/app/views/alchemy_crm/admin/newsletters/_form.html.erb +52 -52
  66. data/app/views/alchemy_crm/admin/newsletters/_tag_with_radiobutton.html.erb +5 -5
  67. data/app/views/alchemy_crm/admin/newsletters/index.html.erb +29 -29
  68. data/app/views/alchemy_crm/admin/newsletters/new.html.erb +4 -4
  69. data/app/views/alchemy_crm/admin/tags/_radio_tag.html.erb +4 -4
  70. data/app/views/alchemy_crm/admin/tags/_tag.html.erb +30 -30
  71. data/app/views/alchemy_crm/admin/tags/edit.html.erb +32 -32
  72. data/app/views/alchemy_crm/admin/tags/index.html.erb +23 -23
  73. data/app/views/alchemy_crm/admin/tags/new.html.erb +14 -14
  74. data/app/views/alchemy_crm/contacts_mailer/signout_mail.html.erb +6 -6
  75. data/app/views/alchemy_crm/contacts_mailer/signout_mail.text.erb +2 -2
  76. data/app/views/alchemy_crm/contacts_mailer/signup_mail.html.erb +9 -9
  77. data/app/views/alchemy_crm/contacts_mailer/signup_mail.text.erb +2 -2
  78. data/app/views/alchemy_crm/mailings_mailer/verification_mail.html.erb +9 -9
  79. data/app/views/alchemy_crm/subscriptions/index.html.erb +4 -4
  80. data/app/views/alchemy_crm/subscriptions_mailer/overview_mail.html.erb +25 -25
  81. data/app/views/alchemy_crm/subscriptions_mailer/overview_mail.text.erb +2 -2
  82. data/app/views/csv_magic/import_errors.html.erb +23 -23
  83. data/app/views/csv_magic/mapper.html.erb +46 -46
  84. data/app/views/layouts/alchemy_crm/mailings.html.erb +177 -177
  85. data/config/initializers/assets.rb +2 -2
  86. data/config/locales/alchemy_crm.de.yml +1 -1
  87. data/config/locales/alchemy_crm.en.yml +1 -0
  88. data/config/locales/localized_country_select.de.rb +260 -260
  89. data/config/locales/localized_country_select.en.rb +274 -274
  90. data/config/routes.rb +67 -67
  91. data/db/migrate/20111104125306_remove_sent_mailing_pdf_id_from_sent_mailings.rb +1 -1
  92. data/db/migrate/20111124145923_namespace_alchemy_crm_models.rb +13 -13
  93. data/db/migrate/20120307160721_rename_alchemy_crm_recipients_sent_mailing_id.rb +3 -3
  94. data/db/migrate/20120320103412_add_indexes_to_alchemy_crm_sha1_columns.rb +3 -3
  95. data/db/migrate/20120327174301_add_more_indexes_to_alchemy_crm_tables.rb +10 -10
  96. data/lib/alchemy_crm.rb +15 -15
  97. data/lib/alchemy_crm/bounced_delivery.rb +38 -38
  98. data/lib/alchemy_crm/config.rb +25 -25
  99. data/lib/alchemy_crm/engine.rb +31 -31
  100. data/lib/alchemy_crm/i18n_helpers.rb +28 -28
  101. data/lib/alchemy_crm/newsletter_layout.rb +28 -28
  102. data/lib/alchemy_crm/seeder.rb +26 -26
  103. data/lib/alchemy_crm/version.rb +1 -1
  104. data/lib/generators/alchemy_crm/scaffold/files/newsletters.html.erb +19 -19
  105. data/lib/generators/alchemy_crm/scaffold/scaffold_generator.rb +2 -2
  106. data/lib/tasks/alchemy_crm.rake +22 -22
  107. data/lib/tasks/routes.rake +25 -25
  108. data/spec/config_spec.rb +24 -24
  109. data/spec/controllers/alchemy_crm/contacts_controller_spec.rb +147 -147
  110. data/spec/controllers/alchemy_crm/mailings_controller_spec.rb +62 -62
  111. data/spec/controllers/alchemy_crm/recipients_controller_spec.rb +109 -109
  112. data/spec/helpers/alchemy_crm/mailings_helper_spec.rb +165 -165
  113. data/spec/mailers/alchemy_crm/contacts_mailer_spec.rb +84 -84
  114. data/spec/mailers/alchemy_crm/mailings_mailer_spec.rb +29 -29
  115. data/spec/models/alchemy_crm/contact_group_spec.rb +25 -25
  116. data/spec/models/alchemy_crm/contact_spec.rb +71 -71
  117. data/spec/models/alchemy_crm/delivery_spec.rb +43 -39
  118. data/spec/models/alchemy_crm/mailing_spec.rb +46 -42
  119. data/spec/models/alchemy_crm/newsletter_spec.rb +29 -29
  120. data/spec/spec_helper.rb +36 -36
  121. metadata +6 -8
  122. data/rails/init.rb +0 -1
  123. data/recipes/alchemy-mailings-capistrano-tasks.rb +0 -12
@@ -1,4 +1,4 @@
1
1
  <%= @element.content_by_name("text").essence.stripped_body % {
2
- :link => alchemy_crm.disable_contact_url(:token => @contact.email_sha1),
3
- :name => @contact.fullname
2
+ :link => alchemy_crm.disable_contact_url(:token => @contact.email_sha1),
3
+ :name => @contact.fullname
4
4
  } rescue "" %>
@@ -1,11 +1,11 @@
1
1
  <html>
2
- <body>
3
- <%= raw @element.ingredient("text") % {
4
- :link => link_to(
5
- url = alchemy_crm.verify_contact_url(:token => @contact.email_sha1, :newsletter_ids => @newsletter_ids),
6
- url
7
- ),
8
- :name => @contact.fullname
9
- } rescue "" %>
10
- </body>
2
+ <body>
3
+ <%= raw @element.ingredient("text") % {
4
+ :link => link_to(
5
+ url = alchemy_crm.verify_contact_url(:token => @contact.email_sha1, :newsletter_ids => @newsletter_ids),
6
+ url
7
+ ),
8
+ :name => @contact.fullname
9
+ } rescue "" %>
10
+ </body>
11
11
  </html>
@@ -1,4 +1,4 @@
1
1
  <%= @element.content_by_name('text').essence.stripped_body % {
2
- :link => alchemy_crm.verify_contact_url(:token => @contact.email_sha1, :newsletter_ids => @newsletter_ids),
3
- :name => @contact.fullname
2
+ :link => alchemy_crm.verify_contact_url(:token => @contact.email_sha1, :newsletter_ids => @newsletter_ids),
3
+ :name => @contact.fullname
4
4
  } rescue "" %>
@@ -1,11 +1,11 @@
1
1
  <html>
2
- <body>
3
- <%= @element.content_by_name("email_text").ingredient % {
4
- :link => link_to(
5
- url = verify_mailing_url(@contact.email_sha1, :host => @server, :newsletter_ids => @newsletter_ids, :element_id => @element.id),
6
- url
7
- ),
8
- :name => @contact.fullname
9
- } %>
10
- </body>
2
+ <body>
3
+ <%= @element.content_by_name("email_text").ingredient % {
4
+ :link => link_to(
5
+ url = verify_mailing_url(@contact.email_sha1, :host => @server, :newsletter_ids => @newsletter_ids, :element_id => @element.id),
6
+ url
7
+ ),
8
+ :name => @contact.fullname
9
+ } %>
10
+ </body>
11
11
  </html>
@@ -7,16 +7,16 @@
7
7
  <% if @contact.nil? -%>
8
8
 
9
9
  <%= form_tag alchemy_crm.overview_subscriptions_path do %>
10
- <%= label_tag :email, translate_model_attribute(:contact, :email) %>
11
- <%= email_field_tag :email %>
12
- <%= submit_tag alchemy_crm_t('Send subscriptions overview', :name => nil) %>
10
+ <%= label_tag :email, translate_model_attribute(:contact, :email) %>
11
+ <%= email_field_tag :email %>
12
+ <%= submit_tag alchemy_crm_t('Send subscriptions overview', :name => nil) %>
13
13
  <% end -%>
14
14
 
15
15
  <% else -%>
16
16
 
17
17
  <% @contact.subscriptions.each do |subscription| -%>
18
18
  <ul id="newsletter_subscriptions">
19
- <li><%= subscription.newsletter.name %></li>
19
+ <li><%= subscription.newsletter.name %></li>
20
20
  </ul>
21
21
  <% end -%>
22
22
 
@@ -1,27 +1,27 @@
1
1
  <html>
2
- <body>
3
- <%= @element.ingredient("email_text") % {
4
- :link => destroy_contact_url(
5
- :token => @contact.email_sha1,
6
- :host => @server,
7
- :element_id => @element.id
8
- ),
9
- :name => @contact.fullname
10
- } %>
11
- <%- @subscriptions.each do |subscription| -%>
12
- <ul>
13
- <li>
14
- <%= subscription.newsletter.name %>
15
- <%= link_to(
16
- t("newsletter.signout_email.signout", :scope => 'alchemy_crm'),
17
- signout_from_newsletter_url(
18
- :token => @contact.email_sha1,
19
- :subscription_id => subscription.id,
20
- :element_id => @element.id
21
- )
22
- ) %>
23
- </li>
24
- </ul>
25
- <%- end -%>
26
- </body>
2
+ <body>
3
+ <%= @element.ingredient("email_text") % {
4
+ :link => destroy_contact_url(
5
+ :token => @contact.email_sha1,
6
+ :host => @server,
7
+ :element_id => @element.id
8
+ ),
9
+ :name => @contact.fullname
10
+ } %>
11
+ <%- @subscriptions.each do |subscription| -%>
12
+ <ul>
13
+ <li>
14
+ <%= subscription.newsletter.name %>
15
+ <%= link_to(
16
+ t("newsletter.signout_email.signout", :scope => 'alchemy_crm'),
17
+ signout_from_newsletter_url(
18
+ :token => @contact.email_sha1,
19
+ :subscription_id => subscription.id,
20
+ :element_id => @element.id
21
+ )
22
+ ) %>
23
+ </li>
24
+ </ul>
25
+ <%- end -%>
26
+ </body>
27
27
  </html>
@@ -1,7 +1,7 @@
1
1
  <%= @element.ingredient("email_text") % {
2
2
  :link => destroy_contact_url(
3
- :token => @contact.email_sha1,
4
- :element_id => @element.id
3
+ :token => @contact.email_sha1,
4
+ :element_id => @element.id
5
5
  ),
6
6
  :name => @contact.fullname
7
7
  } %>
@@ -1,44 +1,44 @@
1
1
  <%- content_for(:javascript_includes) do -%>
2
- <%= javascript_include_tag "alchemy_crm/scripts.js" %>
2
+ <%= javascript_include_tag "alchemy_crm/scripts.js" %>
3
3
  <%- end -%>
4
4
 
5
5
  <%- content_for(:stylesheets) do -%>
6
- <%= stylesheet_link_tag('alchemy_crm/styles') %>
6
+ <%= stylesheet_link_tag('alchemy_crm/styles') %>
7
7
  <%- end -%>
8
8
 
9
9
  <% if @valid_contacts.present? -%>
10
10
  <div class="flash notice" style="margin: 8px 0">
11
- <%= render_icon('true') %>
12
- <%= alchemy_crm_t('%{count} contacts imported successfully') % {:count => @valid_contacts.length} %>
11
+ <%= render_icon('true') %>
12
+ <%= alchemy_crm_t('%{count} contacts imported successfully') % {:count => @valid_contacts.length} %>
13
13
  </div>
14
14
  <% end -%>
15
15
 
16
16
  <h1><%= alchemy_crm_t(:errors_while_importing_contacts) %></h1>
17
17
 
18
18
  <div class="info">
19
- <%= render_icon('info') %>
20
- <p><%= alchemy_crm_t(:contacts_imported_with_errors_notice) %></p>
19
+ <%= render_icon('info') %>
20
+ <p><%= alchemy_crm_t(:contacts_imported_with_errors_notice) %></p>
21
21
  </div>
22
22
 
23
23
  <table class="list" style="margin-bottom: 1em">
24
- <tr>
25
- <th><%= translate_model_attribute(:contact, :name).gsub(/\*$/, '') %></th>
26
- <th><%= translate_model_attribute(:contact, :email).gsub(/\*$/, '') %></th>
27
- <th><%= alchemy_crm_t(:errors) %></th>
28
- </tr>
29
- <% @csv_import_errors.each do |error| -%>
30
- <tr class="<%= cycle("even", "odd") -%>">
31
- <td><%= error.first.fullname -%></td>
32
- <td><%= error.first.email -%></td>
33
- <td>
34
- <% error[1].full_messages.each do |message| -%>
35
- <p><%= message -%></p>
36
- <% end -%>
37
- </td>
38
- </tr>
39
- <% end -%>
24
+ <tr>
25
+ <th><%= translate_model_attribute(:contact, :name).gsub(/\*$/, '') %></th>
26
+ <th><%= translate_model_attribute(:contact, :email).gsub(/\*$/, '') %></th>
27
+ <th><%= alchemy_crm_t(:errors) %></th>
28
+ </tr>
29
+ <% @csv_import_errors.each do |error| -%>
30
+ <tr class="<%= cycle("even", "odd") -%>">
31
+ <td><%= error.first.fullname -%></td>
32
+ <td><%= error.first.email -%></td>
33
+ <td>
34
+ <% error[1].full_messages.each do |message| -%>
35
+ <p><%= message -%></p>
36
+ <% end -%>
37
+ </td>
38
+ </tr>
39
+ <% end -%>
40
40
  </table>
41
41
 
42
42
  <p>
43
- <%= link_to t(:continue), admin_contacts_path, :class => 'button' %>
43
+ <%= link_to t(:continue), admin_contacts_path, :class => 'button' %>
44
44
  </p>
@@ -1,62 +1,62 @@
1
1
  <%- content_for(:javascript_includes) do -%>
2
- <%= javascript_include_tag "alchemy_crm/scripts.js" %>
2
+ <%= javascript_include_tag "alchemy_crm/scripts.js" %>
3
3
  <%- end -%>
4
4
 
5
5
  <%- content_for(:stylesheets) do -%>
6
- <%= stylesheet_link_tag('alchemy_crm/styles') %>
6
+ <%= stylesheet_link_tag('alchemy_crm/styles') %>
7
7
  <%- end -%>
8
8
 
9
9
  <% toolbar(
10
- :buttons => [
11
- {
12
- :icon => :close,
13
- :label => t(:cancel),
14
- :url => alchemy_crm.admin_contacts_path,
15
- :title => t(:cancel),
16
- :overlay => false,
17
- :if_permitted_to => [:index, :alchemy_crm_admin_contacts]
18
- }
19
- ],
20
- :search => false
10
+ :buttons => [
11
+ {
12
+ :icon => :close,
13
+ :label => t(:cancel),
14
+ :url => alchemy_crm.admin_contacts_path,
15
+ :title => t(:cancel),
16
+ :overlay => false,
17
+ :if_permitted_to => [:index, :alchemy_crm_admin_contacts]
18
+ }
19
+ ],
20
+ :search => false
21
21
  ) -%>
22
22
 
23
23
  <h1><%= alchemy_crm_t(:import_contacts_from_csv_file) %></h1>
24
24
 
25
25
  <div class="info">
26
- <%= render_icon('info') %>
27
- <p><%= alchemy_crm_t(:map_columns) %></p>
26
+ <%= render_icon('info') %>
27
+ <p><%= alchemy_crm_t(:map_columns) %></p>
28
28
  </div>
29
29
 
30
30
  <%= form_tag nil, :id => 'map_fields_form', :method => :post do -%>
31
- <%= hidden_field_tag :filename, @mapper.filename %>
32
- <table class="list">
33
- <tr>
34
- <%- header = @raw_data.first -%>
35
- <%- header.size.times do |column_index| -%>
36
- <th>
37
- <%= select_tag("fields[#{column_index + 1}]", options_for_select(
38
- @mapper.map_fields,
39
- @mapper.map_fields[header[column_index]]
40
- ), :include_blank => true, :class => 'alchemy_selectbox medium') %>
41
- </th>
42
- <%- end -%>
43
- </tr>
44
- <%- @raw_data[0..5].each do |row| -%>
45
- <tr class="<%= cycle('even', 'odd') -%>">
46
- <%- row.each do |column| -%>
47
- <td><%= h(column) -%></td>
48
- <%- end -%>
49
- </tr>
50
- <%- end -%>
51
- </table>
52
- <div class="with_padding">
53
- <p>
54
- <%= check_box_tag 'ignore_first_row', '1', true %>
55
- <%= label_tag 'ignore_first_row', alchemy_crm_t(:ignore_first_row) %>
56
- </p>
57
- </div>
58
- <div class="action">
59
- <%= hidden_field_tag :verified, params[:verified] %>
60
- <%= button_tag alchemy_crm_t(:import), :name => nil, :class => 'button' %>
61
- </div>
31
+ <%= hidden_field_tag :filename, @mapper.filename %>
32
+ <table class="list">
33
+ <tr>
34
+ <%- header = @raw_data.first -%>
35
+ <%- header.size.times do |column_index| -%>
36
+ <th>
37
+ <%= select_tag("fields[#{column_index + 1}]", options_for_select(
38
+ @mapper.map_fields,
39
+ header[column_index].to_s.to_sym
40
+ ), :include_blank => true, :class => 'alchemy_selectbox medium') %>
41
+ </th>
42
+ <%- end -%>
43
+ </tr>
44
+ <%- @raw_data[0..5].each do |row| -%>
45
+ <tr class="<%= cycle('even', 'odd') -%>">
46
+ <%- row.each do |column| -%>
47
+ <td><%= h(column) -%></td>
48
+ <%- end -%>
49
+ </tr>
50
+ <%- end -%>
51
+ </table>
52
+ <div class="with_padding">
53
+ <p>
54
+ <%= check_box_tag 'ignore_first_row', '1', true %>
55
+ <%= label_tag 'ignore_first_row', alchemy_crm_t(:ignore_first_row) %>
56
+ </p>
57
+ </div>
58
+ <div class="action">
59
+ <%= hidden_field_tag :verified, params[:verified] %>
60
+ <%= button_tag alchemy_crm_t(:import), :name => nil, :class => 'button' %>
61
+ </div>
62
62
  <%- end -%>
@@ -23,188 +23,188 @@ Email on Acid - http://www.emailonacid.com/blog/details/C18/doctype_-_the_black_
23
23
 
24
24
  <html xmlns="http://www.w3.org/1999/xhtml">
25
25
  <head>
26
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
28
- <title><%= @mailing.subject %></title>
29
- <style type="text/css">
30
-
31
- /***********
32
- Originally based on The MailChimp Reset from Fabio Carneiro, MailChimp User Experience Design
33
- More info and templates on Github: https://github.com/mailchimp/Email-Blueprints
34
- http://www.mailchimp.com &amp; http://www.fabio-carneiro.com
35
-
36
- INLINE: Yes.
37
- ***********/
38
- /* Client-specific Styles */
39
- #outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
40
- body{width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0;}
41
- /* Prevent Webkit and Windows Mobile platforms from changing default font sizes, while not breaking desktop design. */
42
- .ExternalClass {width:100%;} /* Force Hotmail to display emails at full width */
43
- .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} /* Force Hotmail to display normal line spacing. More on that: http://www.emailonacid.com/forum/viewthread/43/ */
44
- #backgroundTable {margin:0; padding:0; width:100% !important; line-height: 100% !important;}
45
- /* End reset */
46
-
47
- /* Some sensible defaults for images
48
- 1. "-ms-interpolation-mode: bicubic" works to help ie properly resize images in IE. (if you are resizing them using the width and height attributes)
49
- 2. "border:none" removes border when linking images.
50
- 3. Updated the common Gmail/Hotmail image display fix: Gmail and Hotmail unwantedly adds in an extra space below images when using non IE browsers. You may not always want all of your images to be block elements. Apply the "image_fix" class to any image you need to fix.
51
-
52
- Bring inline: Yes.
53
- */
54
- img {outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;}
55
- a img {border:none;}
56
- .image_fix {display:block;}
57
-
58
- /** Yahoo paragraph fix: removes the proper spacing or the paragraph (p) tag. To correct we set the top/bottom margin to 1em in the head of the document. Simple fix with little effect on other styling. NOTE: It is also common to use two breaks instead of the paragraph tag but I think this way is cleaner and more semantic. NOTE: This example recommends 1em. More info on setting web defaults: http://www.w3.org/TR/CSS21/sample.html or http://meiert.com/en/blog/20070922/user-agent-style-sheets/
59
-
60
- Bring inline: Yes.
61
- **/
62
- p {margin: 1em 0;}
63
-
64
- /** Hotmail header color reset: Hotmail replaces your header color styles with a green color on H2, H3, H4, H5, and H6 tags. In this example, the color is reset to black for a non-linked header, blue for a linked header, red for an active header (limited support), and purple for a visited header (limited support). Replace with your choice of color. The !important is really what is overriding Hotmail's styling. Hotmail also sets the H1 and H2 tags to the same size.
65
-
66
- Bring inline: Yes.
67
- **/
68
- h1, h2, h3, h4, h5, h6 {color: black !important;}
69
-
70
- h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {color: blue !important;}
71
-
72
- h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
73
- color: red !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
74
- }
75
-
76
- h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
77
- color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
78
- }
79
-
80
- /** Outlook 07, 10 Padding issue: These "newer" versions of Outlook add some padding around table cells potentially throwing off your perfectly pixeled table. The issue can cause added space and also throw off borders completely. Use this fix in your header or inline to safely fix your table woes.
81
-
82
- More info: http://www.ianhoar.com/2008/04/29/outlook-2007-borders-and-1px-padding-on-table-cells/
83
- http://www.campaignmonitor.com/blog/post/3392/1px-borders-padding-on-table-cells-in-outlook-07/
84
-
85
- H/T @edmelly
86
-
87
- Bring inline: No.
88
- **/
89
- table td {border-collapse: collapse;}
90
-
91
- /* Styling your links has become much simpler with the new Yahoo. In fact, it falls in line with the main credo of styling in email, bring your styles inline. Your link colors will be uniform across clients when brought inline.
92
-
93
- Bring inline: Yes. */
94
- a {color: orange;}
95
-
96
- /* Or to go the gold star route...
97
- a:link { color: orange; }
98
- a:visited { color: blue; }
99
- a:hover { color: green; }
100
- */
101
-
102
- /***************************************************
103
- ****************************************************
104
- MOBILE TARGETING
105
-
106
- Use @media queries with care. You should not bring these styles inline -- so it's recommended to apply them AFTER you bring the other stlying inline.
107
-
108
- Note: test carefully with Yahoo.
109
- Note 2: Don't bring anything below this line inline.
110
- ****************************************************
111
- ***************************************************/
112
-
113
- /* NOTE: To properly use @media queries and play nice with yahoo mail, use attribute selectors in place of class, id declarations.
114
- table[class=classname]
115
- Read more: http://www.campaignmonitor.com/blog/post/3457/media-query-issues-in-yahoo-mail-mobile-email/
116
- */
117
- @media only screen and (max-device-width: 480px) {
118
-
119
- /* A nice and clean way to target phone numbers you want clickable and avoid a mobile phone from linking other numbers that look like, but are not phone numbers. Use these two blocks of code to "unstyle" any numbers that may be linked. The second block gives you a class to apply with a span tag to the numbers you would like linked and styled.
120
-
121
- Inspired by Campaign Monitor's article on using phone numbers in email: http://www.campaignmonitor.com/blog/post/3571/using-phone-numbers-in-html-email/.
122
-
123
- Step 1 (Step 2: line 224)
124
- */
125
- a[href^="tel"], a[href^="sms"] {
126
- text-decoration: none;
127
- color: black; /* or whatever your want */
128
- pointer-events: none;
129
- cursor: default;
130
- }
131
-
132
- .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
133
- text-decoration: default;
134
- color: orange !important; /* or whatever your want */
135
- pointer-events: auto;
136
- cursor: default;
137
- }
138
- }
139
-
140
- /* More Specific Targeting */
141
-
142
- @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
143
- /* You guessed it, ipad (tablets, smaller screens, etc) */
144
-
145
- /* Step 1a: Repeating for the iPad */
146
- a[href^="tel"], a[href^="sms"] {
147
- text-decoration: none;
148
- color: blue; /* or whatever your want */
149
- pointer-events: none;
150
- cursor: default;
151
- }
152
-
153
- .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
154
- text-decoration: default;
155
- color: orange !important;
156
- pointer-events: auto;
157
- cursor: default;
158
- }
159
- }
160
-
161
- @media only screen and (-webkit-min-device-pixel-ratio: 2) {
162
- /* Put your iPhone 4g styles in here */
163
- }
164
-
165
- /* Following Android targeting from:
166
- http://developer.android.com/guide/webapps/targeting.html
167
- http://pugetworks.com/2011/04/css-media-queries-for-targeting-different-mobile-devices/ */
168
- @media only screen and (-webkit-device-pixel-ratio:.75){
169
- /* Put CSS for low density (ldpi) Android layouts in here */
170
- }
171
- @media only screen and (-webkit-device-pixel-ratio:1){
172
- /* Put CSS for medium density (mdpi) Android layouts in here */
173
- }
174
- @media only screen and (-webkit-device-pixel-ratio:1.5){
175
- /* Put CSS for high density (hdpi) Android layouts in here */
176
- }
177
- /* end Android targeting */
178
- </style>
179
-
180
- <!-- Targeting Windows Mobile -->
181
- <!--[if IEMobile 7]>
182
- <style type="text/css">
183
-
184
- </style>
185
- <![endif]-->
186
-
187
- <!-- ***********************************************
188
- ****************************************************
189
- END MOBILE TARGETING
190
- ****************************************************
191
- ************************************************ -->
192
-
193
- <!--[if gte mso 9]>
194
- <style>
195
- /* Target Outlook 2007 and 2010 */
196
- </style>
197
- <![endif]-->
26
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
27
+ <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
28
+ <title><%= @mailing.subject %></title>
29
+ <style type="text/css">
30
+
31
+ /***********
32
+ Originally based on The MailChimp Reset from Fabio Carneiro, MailChimp User Experience Design
33
+ More info and templates on Github: https://github.com/mailchimp/Email-Blueprints
34
+ http://www.mailchimp.com &amp; http://www.fabio-carneiro.com
35
+
36
+ INLINE: Yes.
37
+ ***********/
38
+ /* Client-specific Styles */
39
+ #outlook a {padding:0;} /* Force Outlook to provide a "view in browser" menu link. */
40
+ body{width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0; padding:0;}
41
+ /* Prevent Webkit and Windows Mobile platforms from changing default font sizes, while not breaking desktop design. */
42
+ .ExternalClass {width:100%;} /* Force Hotmail to display emails at full width */
43
+ .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} /* Force Hotmail to display normal line spacing. More on that: http://www.emailonacid.com/forum/viewthread/43/ */
44
+ #backgroundTable {margin:0; padding:0; width:100% !important; line-height: 100% !important;}
45
+ /* End reset */
46
+
47
+ /* Some sensible defaults for images
48
+ 1. "-ms-interpolation-mode: bicubic" works to help ie properly resize images in IE. (if you are resizing them using the width and height attributes)
49
+ 2. "border:none" removes border when linking images.
50
+ 3. Updated the common Gmail/Hotmail image display fix: Gmail and Hotmail unwantedly adds in an extra space below images when using non IE browsers. You may not always want all of your images to be block elements. Apply the "image_fix" class to any image you need to fix.
51
+
52
+ Bring inline: Yes.
53
+ */
54
+ img {outline:none; text-decoration:none; -ms-interpolation-mode: bicubic;}
55
+ a img {border:none;}
56
+ .image_fix {display:block;}
57
+
58
+ /** Yahoo paragraph fix: removes the proper spacing or the paragraph (p) tag. To correct we set the top/bottom margin to 1em in the head of the document. Simple fix with little effect on other styling. NOTE: It is also common to use two breaks instead of the paragraph tag but I think this way is cleaner and more semantic. NOTE: This example recommends 1em. More info on setting web defaults: http://www.w3.org/TR/CSS21/sample.html or http://meiert.com/en/blog/20070922/user-agent-style-sheets/
59
+
60
+ Bring inline: Yes.
61
+ **/
62
+ p {margin: 1em 0;}
63
+
64
+ /** Hotmail header color reset: Hotmail replaces your header color styles with a green color on H2, H3, H4, H5, and H6 tags. In this example, the color is reset to black for a non-linked header, blue for a linked header, red for an active header (limited support), and purple for a visited header (limited support). Replace with your choice of color. The !important is really what is overriding Hotmail's styling. Hotmail also sets the H1 and H2 tags to the same size.
65
+
66
+ Bring inline: Yes.
67
+ **/
68
+ h1, h2, h3, h4, h5, h6 {color: black !important;}
69
+
70
+ h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {color: blue !important;}
71
+
72
+ h1 a:active, h2 a:active, h3 a:active, h4 a:active, h5 a:active, h6 a:active {
73
+ color: red !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
74
+ }
75
+
76
+ h1 a:visited, h2 a:visited, h3 a:visited, h4 a:visited, h5 a:visited, h6 a:visited {
77
+ color: purple !important; /* Preferably not the same color as the normal header link color. There is limited support for psuedo classes in email clients, this was added just for good measure. */
78
+ }
79
+
80
+ /** Outlook 07, 10 Padding issue: These "newer" versions of Outlook add some padding around table cells potentially throwing off your perfectly pixeled table. The issue can cause added space and also throw off borders completely. Use this fix in your header or inline to safely fix your table woes.
81
+
82
+ More info: http://www.ianhoar.com/2008/04/29/outlook-2007-borders-and-1px-padding-on-table-cells/
83
+ http://www.campaignmonitor.com/blog/post/3392/1px-borders-padding-on-table-cells-in-outlook-07/
84
+
85
+ H/T @edmelly
86
+
87
+ Bring inline: No.
88
+ **/
89
+ table td {border-collapse: collapse;}
90
+
91
+ /* Styling your links has become much simpler with the new Yahoo. In fact, it falls in line with the main credo of styling in email, bring your styles inline. Your link colors will be uniform across clients when brought inline.
92
+
93
+ Bring inline: Yes. */
94
+ a {color: orange;}
95
+
96
+ /* Or to go the gold star route...
97
+ a:link { color: orange; }
98
+ a:visited { color: blue; }
99
+ a:hover { color: green; }
100
+ */
101
+
102
+ /***************************************************
103
+ ****************************************************
104
+ MOBILE TARGETING
105
+
106
+ Use @media queries with care. You should not bring these styles inline -- so it's recommended to apply them AFTER you bring the other stlying inline.
107
+
108
+ Note: test carefully with Yahoo.
109
+ Note 2: Don't bring anything below this line inline.
110
+ ****************************************************
111
+ ***************************************************/
112
+
113
+ /* NOTE: To properly use @media queries and play nice with yahoo mail, use attribute selectors in place of class, id declarations.
114
+ table[class=classname]
115
+ Read more: http://www.campaignmonitor.com/blog/post/3457/media-query-issues-in-yahoo-mail-mobile-email/
116
+ */
117
+ @media only screen and (max-device-width: 480px) {
118
+
119
+ /* A nice and clean way to target phone numbers you want clickable and avoid a mobile phone from linking other numbers that look like, but are not phone numbers. Use these two blocks of code to "unstyle" any numbers that may be linked. The second block gives you a class to apply with a span tag to the numbers you would like linked and styled.
120
+
121
+ Inspired by Campaign Monitor's article on using phone numbers in email: http://www.campaignmonitor.com/blog/post/3571/using-phone-numbers-in-html-email/.
122
+
123
+ Step 1 (Step 2: line 224)
124
+ */
125
+ a[href^="tel"], a[href^="sms"] {
126
+ text-decoration: none;
127
+ color: black; /* or whatever your want */
128
+ pointer-events: none;
129
+ cursor: default;
130
+ }
131
+
132
+ .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
133
+ text-decoration: default;
134
+ color: orange !important; /* or whatever your want */
135
+ pointer-events: auto;
136
+ cursor: default;
137
+ }
138
+ }
139
+
140
+ /* More Specific Targeting */
141
+
142
+ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
143
+ /* You guessed it, ipad (tablets, smaller screens, etc) */
144
+
145
+ /* Step 1a: Repeating for the iPad */
146
+ a[href^="tel"], a[href^="sms"] {
147
+ text-decoration: none;
148
+ color: blue; /* or whatever your want */
149
+ pointer-events: none;
150
+ cursor: default;
151
+ }
152
+
153
+ .mobile_link a[href^="tel"], .mobile_link a[href^="sms"] {
154
+ text-decoration: default;
155
+ color: orange !important;
156
+ pointer-events: auto;
157
+ cursor: default;
158
+ }
159
+ }
160
+
161
+ @media only screen and (-webkit-min-device-pixel-ratio: 2) {
162
+ /* Put your iPhone 4g styles in here */
163
+ }
164
+
165
+ /* Following Android targeting from:
166
+ http://developer.android.com/guide/webapps/targeting.html
167
+ http://pugetworks.com/2011/04/css-media-queries-for-targeting-different-mobile-devices/ */
168
+ @media only screen and (-webkit-device-pixel-ratio:.75){
169
+ /* Put CSS for low density (ldpi) Android layouts in here */
170
+ }
171
+ @media only screen and (-webkit-device-pixel-ratio:1){
172
+ /* Put CSS for medium density (mdpi) Android layouts in here */
173
+ }
174
+ @media only screen and (-webkit-device-pixel-ratio:1.5){
175
+ /* Put CSS for high density (hdpi) Android layouts in here */
176
+ }
177
+ /* end Android targeting */
178
+ </style>
179
+
180
+ <!-- Targeting Windows Mobile -->
181
+ <!--[if IEMobile 7]>
182
+ <style type="text/css">
183
+
184
+ </style>
185
+ <![endif]-->
186
+
187
+ <!-- ***********************************************
188
+ ****************************************************
189
+ END MOBILE TARGETING
190
+ ****************************************************
191
+ ************************************************ -->
192
+
193
+ <!--[if gte mso 9]>
194
+ <style>
195
+ /* Target Outlook 2007 and 2010 */
196
+ </style>
197
+ <![endif]-->
198
198
  </head>
199
199
  <body>
200
200
  <%= render_tracking_image %>
201
201
  <!-- Wrapper/Container Table: Use a wrapper table to control the width and the background color consistently of your email. Use this approach instead of setting attributes on the body tag. -->
202
202
  <table cellpadding="0" cellspacing="0" border="0" id="backgroundTable">
203
- <tr>
204
- <td valign="top">
205
- <%= render_newsletter_layout %>
206
- </td>
207
- </tr>
203
+ <tr>
204
+ <td valign="top">
205
+ <%= render_newsletter_layout %>
206
+ </td>
207
+ </tr>
208
208
  </table>
209
209
  <!-- End of wrapper table -->
210
210
  <%= alchemy_preview_mode_code %>