/// <summary> /// Get collection of allowed (supported) message tokens /// </summary> /// <param name="tokenGroups">Collection of token groups; pass null to get all available tokens</param> /// <returns>Collection of allowed message tokens</returns> public virtual IEnumerable <string> GetListOfAllowedTokens(IEnumerable <string> tokenGroups = null) { var additionTokens = new AdditionTokensAddedEvent(); _eventPublisher.Publish(additionTokens); var allowedTokens = AllowedTokens.Where(x => tokenGroups == null || tokenGroups.Contains(x.Key)) .SelectMany(x => x.Value).ToList(); allowedTokens.AddRange(additionTokens.AdditionTokens); return(allowedTokens.Distinct()); }
/// <summary> /// Get collection of allowed (supported) message tokens /// </summary> /// <param name="tokenGroups">Collection of token groups; pass null to get all available tokens</param> /// <returns>Collection of allowed message tokens</returns> public override IEnumerable <string> GetListOfAllowedTokens(IEnumerable <string> tokenGroups = null) { var additionTokens = new AdditionTokensAddedEvent(); _eventPublisher.Publish(additionTokens); var allowedTokens = AllowedTokens.Where(x => tokenGroups == null || tokenGroups.Contains(x.Key)) .SelectMany(x => x.Value).ToList(); allowedTokens.AddRange(additionTokens.AdditionTokens); // add our custom token allowedTokens.Add("%Custom.Message.Token.CallForInfo%"); return(allowedTokens.Distinct()); }
public virtual string[] GetListOfAllowedTokens() { var additionTokens = new AdditionTokensAddedEvent(); _eventPublisher.Publish(additionTokens); var allowedTokens = new List<string> { "%Store.Name%", "%Store.URL%", "%Store.Email%", "%Store.CompanyName%", "%Store.CompanyAddress%", "%Store.CompanyPhoneNumber%", "%Store.CompanyVat%", "%Order.OrderNumber%", "%Order.CustomerFullName%", "%Order.CustomerEmail%", "%Order.BillingFirstName%", "%Order.BillingLastName%", "%Order.BillingPhoneNumber%", "%Order.BillingEmail%", "%Order.BillingFaxNumber%", "%Order.BillingCompany%", "%Order.BillingAddress1%", "%Order.BillingAddress2%", "%Order.BillingCity%", "%Order.BillingStateProvince%", "%Order.BillingZipPostalCode%", "%Order.BillingCountry%", "%Order.BillingCustomAttributes%", "%Order.ShippingMethod%", "%Order.ShippingFirstName%", "%Order.ShippingLastName%", "%Order.ShippingPhoneNumber%", "%Order.ShippingEmail%", "%Order.ShippingFaxNumber%", "%Order.ShippingCompany%", "%Order.ShippingAddress1%", "%Order.ShippingAddress2%", "%Order.ShippingCity%", "%Order.ShippingStateProvince%", "%Order.ShippingZipPostalCode%", "%Order.ShippingCountry%", "%Order.ShippingCustomAttributes%", "%Order.PaymentMethod%", "%Order.VatNumber%", "%Order.CustomValues%", "%Order.Product(s)%", "%Order.CreatedOn%", "%Order.OrderURLForCustomer%", "%Order.NewNoteText%", "%Order.OrderNoteAttachmentUrl%", "%Order.AmountRefunded%", "%RecurringPayment.ID%", "%Shipment.ShipmentNumber%", "%Shipment.TrackingNumber%", "%Shipment.TrackingNumberURL%", "%Shipment.Product(s)%", "%Shipment.URLForCustomer%", "%ReturnRequest.CustomNumber%", "%ReturnRequest.OrderId%", "%ReturnRequest.Product.Quantity%", "%ReturnRequest.Product.Name%", "%ReturnRequest.Reason%", "%ReturnRequest.RequestedAction%", "%ReturnRequest.CustomerComment%", "%ReturnRequest.StaffNotes%", "%ReturnRequest.Status%", "%GiftCard.SenderName%", "%GiftCard.SenderEmail%", "%GiftCard.RecipientName%", "%GiftCard.RecipientEmail%", "%GiftCard.Amount%", "%GiftCard.CouponCode%", "%GiftCard.Message%", "%Customer.Email%", "%Customer.Username%", "%Customer.FullName%", "%Customer.FirstName%", "%Customer.LastName%", "%Customer.VatNumber%", "%Customer.VatNumberStatus%", "%Customer.PasswordRecoveryURL%", "%Customer.AccountActivationURL%", "%Vendor.Name%", "%Vendor.Email%", "%Wishlist.URLForCustomer%", "%NewsLetterSubscription.Email%", "%NewsLetterSubscription.ActivationUrl%", "%NewsLetterSubscription.DeactivationUrl%", "%ProductReview.ProductName%", "%BlogComment.BlogPostTitle%", "%NewsComment.NewsTitle%", "%Product.ID%", "%Product.Name%", "%Product.ShortDescription%", "%Product.ProductURLForCustomer%", "%Product.SKU%", "%Product.StockQuantity%", "%Forums.TopicURL%", "%Forums.TopicName%", "%Forums.PostAuthor%", "%Forums.PostBody%", "%Forums.ForumURL%", "%Forums.ForumName%", "%AttributeCombination.Formatted%", "%AttributeCombination.SKU%", "%AttributeCombination.StockQuantity%", "%PrivateMessage.Subject%", "%PrivateMessage.Text%", "%BackInStockSubscription.ProductName%", "%BackInStockSubscription.ProductUrl%", "%Facebook.URL%", "%Twitter.URL%", "%YouTube.URL%", "%GooglePlus.URL%" }; allowedTokens.AddRange(additionTokens.AdditionTokens); return allowedTokens.Distinct().ToArray(); }