|
| Please contact info.meatean@gmail.com if you have any questions. |
Helpers
Buttons in emails are hard. This helper makes them easy.
The email_action helper extracts logic for displaying buttons and adding dependable spacing between HTML elements in a given template.
email_action is added automatically when you install Rails UI and appended to your application_helper.rb file.
def email_action(action, url, options={})
align = options[:align] ||= "left"
theme = options[:theme] ||= "primary"
fullwidth = options[:fullwidth] ||= false
render "rui/shared/email_action", align: align, theme: theme, action: action, url: url, fullwidth: fullwidth
end
You'll find the partials referenced above inside the rui/shared view directory. Treat these as read-only as swapping themes may override your changes.
Customize the theming inside the Rails UI mailer layout css.
email_action(action, path, options)
action - required
The button label
path - required
The url for the button. Be sure to use url helpers and not path helpers in an email
theme
primary or secondary. Default: primary.
align
Align button to center, left, or right. Default: left
fullwidth
(boolean) true / false. Default: false
|