helpers: add variants to mailer_round_button

This commit is contained in:
Pierre de La Morinerie 2019-07-22 15:11:03 +02:00
parent 3abb0a1c44
commit 2c612f6448
3 changed files with 28 additions and 8 deletions

View file

@ -1,5 +1,24 @@
module MailerHelper
def round_button(text, url)
render 'shared/mailer_round_button', text: text, url: url
def round_button(text, url, variant)
render 'shared/mailer_round_button', text: text, url: url, theme: theme(variant)
end
private
def theme(variant)
case variant
when :primary
{ color: white, bg_color: blue, border_color: blue }
when :secondary
{ color: blue, bg_color: white, border_color: blue }
end
end
def blue
'#0069CC'
end
def white
'#FFFFFF'
end
end