Class: MailerButtonStyler

Inherits:
Object
  • Object
show all
Defined in:
lib/mailer_button_styler.rb

Overview

This class has methods that help composing emails.

Class Method Summary collapse

Class Method Details

.button_styleObject

Returns a CSS style that styles a link element as a Bootstrap button. This should be used as an inline style in emails, because a lot of email clients do not support linked CSS stylesheets nor style tags.


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/mailer_button_styler.rb', line 11

def self.button_style
  button_style = <<STYLE
      background-image: linear-gradient(to bottom, #428bca 0px, #2d6ca2 100%);
      background-repeat: repeat-x;
      border-color: #2b669a;
      box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 1px 1px rgba(0, 0, 0, 0.075);
      text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.2);
      border-radius: 6px;
      padding: 10px 16px;
      background-color:#428bca;
      color: #fff;
      cursor: pointer;
      display: inline-block;
      text-decoration: none;
      vertical-align: middle;
STYLE

  return button_style
end