1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/views/notifications_mailer/notify_member_about_coupon.html.erb

38 lines
1.1 KiB
Plaintext
Raw Normal View History

2016-08-16 18:12:13 +02:00
<%= render 'notifications_mailer/shared/hello', recipient: @recipient %>
<% if @attached_object.type == 'percent_off' %>
<p><%= t('.body.enjoy_a_discount_of_PERCENT_with_code_CODE',
PERCENT: @attached_object.percent_off,
CODE: @attached_object.code
) %>
</p>
<% else %>
<p><%= t('.body.enjoy_a_discount_of_AMOUNT_with_code_CODE',
AMOUNT: number_to_currency(@attached_object.amount_off / 100.00),
CODE: @attached_object.code
) %>
</p>
<% end %>
2016-08-16 18:12:13 +02:00
<%
# we must tell the user if he can use the code just once or many times (== maximum wasn't specified)
2016-08-16 18:12:13 +02:00
usages = 999 # just a number > 1
if @attached_object.validity_per_user == 'once'
usages = 1
else
unless @attached_object.max_usages.nil?
usages = @attached_object.max_usages
end
end
%>
<p>
<%= _t('.body.this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases',
{
USAGE: usages,
TYPE: @attached_object.type,
2016-08-16 18:12:13 +02:00
DATE: @attached_object.valid_until.nil? ? 'NO-DATE' : I18n.l(@attached_object.valid_until.to_date)
})
# messageFormat
%>
</p>