public virtual async Task <GiftVoucherModel> PrepareGiftVoucherModel(GiftVoucher giftVoucher)
        {
            var   model = giftVoucher.ToModel(_dateTimeService);
            Order order = null;

            if (giftVoucher.PurchasedWithOrderItem != null)
            {
                order = await _orderService.GetOrderByOrderItemId(giftVoucher.PurchasedWithOrderItem.Id);
            }

            var currency = await _currencyService.GetCurrencyByCode(giftVoucher.CurrencyCode);

            if (currency == null)
            {
                currency = await _currencyService.GetPrimaryStoreCurrency();
            }

            model.PurchasedWithOrderId     = giftVoucher.PurchasedWithOrderItem != null ? order?.Id : null;
            model.PurchasedWithOrderNumber = order?.OrderNumber ?? 0;
            model.RemainingAmountStr       = _priceFormatter.FormatPrice(giftVoucher.GetGiftVoucherRemainingAmount(), currency, _workContext.WorkingLanguage, true, false);
            model.AmountStr    = _priceFormatter.FormatPrice(giftVoucher.Amount, currency, _workContext.WorkingLanguage, true, false);
            model.CreatedOn    = _dateTimeService.ConvertToUserTime(giftVoucher.CreatedOnUtc, DateTimeKind.Utc);
            model.CurrencyCode = giftVoucher.CurrencyCode;
            return(model);
        }
        public virtual async Task NotifyRecipient(GiftVoucher giftVoucher, GiftVoucherModel model)
        {
            model = giftVoucher.ToModel(_dateTimeService);
            var order = await FillGiftVoucherModel(giftVoucher, model);

            var languageId = "";

            if (order != null)
            {
                var customerLang = await _languageService.GetLanguageById(order.CustomerLanguageId);

                if (customerLang == null)
                {
                    customerLang = (await _languageService.GetAllLanguages()).FirstOrDefault();
                }
                if (customerLang != null)
                {
                    languageId = customerLang.Id;
                }
            }
            else
            {
                languageId = _languageSettings.DefaultAdminLanguageId;
            }
            int queuedEmailId = await _messageProviderService.SendGiftVoucherMessage(giftVoucher, order, languageId);

            if (queuedEmailId > 0)
            {
                giftVoucher.IsRecipientNotified = true;
                await _giftVoucherService.UpdateGiftVoucher(giftVoucher);

                model.IsRecipientNotified = true;
            }
        }