1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-17 06:52:27 +01:00

[to test] send cash coupon to user by mail

This commit is contained in:
Sylvain 2016-11-24 18:17:49 +01:00
parent ce6877b484
commit 3ce41f0c5c
6 changed files with 21 additions and 10 deletions

View File

@ -38,7 +38,7 @@ Application.Directives.directive 'coupon', [ '$rootScope', 'Coupon', 'growl', '_
if res.type == 'percent_off'
growl.success(_t('the_coupon_has_been_applied_you_get_PERCENT_discount', {PERCENT: res.percent_off}))
else
growl.success(_t('the_coupon_has_been_applied_you_get_DISCOUNT_CURRENCY', {DISCOUNT: res.amount_off, CURRENCY: $rootScope.currencySymbol}))
growl.success(_t('the_coupon_has_been_applied_you_get_AMOUNT_CURRENCY', {AMOUNT: res.amount_off, CURRENCY: $rootScope.currencySymbol}))
, (err) ->
$scope.status = 'invalid'
$scope.coupon = null

View File

@ -1,10 +1,18 @@
<%= render 'notifications_mailer/shared/hello', recipient: @recipient %>
<p><%= t('.body.enjoy_a_discount_of_PERCENT_with_code_CODE',
PERCENT: @attached_object.percent_off,
CODE: @attached_object.code
) %>
</p>
<% 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 %>
<%
# we must tell the use if he could use the code just once or many times (in case we won't specify)
@ -21,6 +29,7 @@
<%= _t('.body.this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases',
{
USAGE: usages,
TYPE: @attached_object.type,
DATE: @attached_object.valid_until.nil? ? 'NO-DATE' : I18n.l(@attached_object.valid_until.to_date)
})
# messageFormat

View File

@ -368,7 +368,7 @@ en:
i_have_a_coupon: "I have a coupon!"
code_: "Code:"
the_coupon_has_been_applied_you_get_PERCENT_discount: "The coupon has been applied. You get a {{PERCENT}}% discount." # angular interpolation
the_coupon_has_been_applied_you_get_DISCOUNT_CURRENCY: "The coupon has been applied. You get a discount of {{DISCOUNT}} {{CURRENCY}}." # angular interpolation
the_coupon_has_been_applied_you_get_AMOUNT_CURRENCY: "The coupon has been applied. You get a discount of {{AMOUNT}} {{CURRENCY}}." # angular interpolation
unable_to_apply_the_coupon_because_disabled: "Unable to apply the coupon: this code was disabled."
unable_to_apply_the_coupon_because_expired: "Unable to apply the coupon: this code has expired."
unable_to_apply_the_coupon_because_sold_out: "Unable to apply the coupon: this code reached its quota."

View File

@ -368,7 +368,7 @@ fr:
i_have_a_coupon: "J'ai un code promo !"
code_: "Code :"
the_coupon_has_been_applied_you_get_PERCENT_discount: "Le code promo a bien été appliqué. Vous bénéficiez d'une remise de {{PERCENT}} %." # angular interpolation
the_coupon_has_been_applied_you_get_DISCOUNT_CURRENCY: "Le code promo a bien été appliqué. Vous bénéficiez d'une remise de {{DISCOUNT}} {{CURRENCY}}." # angular interpolation
the_coupon_has_been_applied_you_get_AMOUNT_CURRENCY: "Le code promo a bien été appliqué. Vous bénéficiez d'une remise de {{AMOUNT}} {{CURRENCY}}." # angular interpolation
unable_to_apply_the_coupon_because_disabled: "Impossible d'appliquer la réduction : ce code promo a été désactivé."
unable_to_apply_the_coupon_because_expired: "Impossible d'appliquer la réduction : ce code promo a expiré."
unable_to_apply_the_coupon_because_sold_out: "Impossible d'appliquer la réduction : ce code promo a atteint son quota."

View File

@ -278,7 +278,8 @@ en:
subject: "Coupon"
body:
enjoy_a_discount_of_PERCENT_with_code_CODE: "Enjoy a discount of %{PERCENT}% on the whole site with the code %{CODE}."
this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases: "This coupon is valid {USAGE, plural, =1{just once} other{many times}}: for all your purchases, from now {DATE, select, NO-DATE{and without time limit} other{and until {DATE}}}."
enjoy_a_discount_of_AMOUNT_with_code_CODE: "Enjoy a discount of %{AMOUNT} on the whole site with the code %{CODE}."
this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases: "This coupon is valid {USAGE, plural, =1{just once} other{many times}}: for all your purchases {TYPE, select, amount_off{at least equal to the amount of the coupon} other{}}, from now {DATE, select, NO-DATE{and without time limit} other{and until {DATE}}}."
shared:
hello: "Hello %{user_name}"

View File

@ -278,7 +278,8 @@ fr:
subject: "Code promo"
body:
enjoy_a_discount_of_PERCENT_with_code_CODE: "Bénéficiez d'une remise de %{PERCENT} % sur tout le site en utilisant le code promo %{CODE}."
this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases: "Ce code promo est valable {USAGE, plural, =1{une seule fois} other{plusieurs fois}} : pour tous vos achats, dès maintenant {DATE, select, NO-DATE{et sans limitation de durée} other{et jusqu'au {DATE}}}."
enjoy_a_discount_of_AMOUNT_with_code_CODE: "Bénéficiez d'une remise de %{AMOUNT} sur tout le site en utilisant le code promo %{CODE}."
this_coupon_is_valid_USAGE_times_until_DATE_for_all_your_purchases: "Ce code promo est valable {USAGE, plural, =1{une seule fois} other{plusieurs fois}} : pour tous vos achats {TYPE, select, amount_off{dont le montant est au moins de celui du code promo} other{}}, dès maintenant {DATE, select, NO-DATE{et sans limitation de durée} other{et jusqu'au {DATE}}}."
shared:
hello: "Bonjour %{user_name}"