Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

1.1 KB
Raw Blame
using DotLiquid;
using Grand.Domain.Orders;
using Grand.SharedKernel.Extensions;

namespace Grand.Business.Core.Utilities.Messages.DotLiquidDrops;

public class LiquidGiftVoucher : Drop
{
    private readonly GiftVoucher _giftVoucher;

    public LiquidGiftVoucher(GiftVoucher giftVoucher)
    {
        _giftVoucher = giftVoucher;

        AdditionalTokens = new Dictionary<string, string>();
    }

    public string SenderName => _giftVoucher.SenderName;

    public string SenderEmail => _giftVoucher.SenderEmail;

    public string RecipientName => _giftVoucher.RecipientName;

    public string RecipientEmail => _giftVoucher.RecipientEmail;

    public string Amount { get; set; }

    public string CouponCode => _giftVoucher.Code;

    public string Message {
        get {
            var giftVoucherMesage = !string.IsNullOrWhiteSpace(_giftVoucher.Message)
                ? FormatText.ConvertText(_giftVoucher.Message)
                : "";
            return giftVoucherMesage;
        }
    }

    public IDictionary<string, string> AdditionalTokens { get; set; }
}