Exception in template (Designs/Default/_parsed/Mail_Page.parsed.cshtml): System.NullReferenceException: Object reference not set to an instance of an object.
   at CompiledRazorTemplates.Dynamic.bccdafbea.b__16(Paragraph o)
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at CompiledRazorTemplates.Dynamic.bccdafbea.Execute()
   at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
   at RazorEngine.Razor.Parse[T](String razorTemplate, T model, String cacheName)
   at Dynamicweb.Rendering.Template.Output()
@inherits Dynamicweb.Rendering.RazorTemplateBase<Dynamicweb.Rendering.RazorTemplateModel<Dynamicweb.Rendering.Template>> @using System.Web; @using System.Globalization @using System.IO @using System.Web @helper RenderGoogleConversion(string conversionId, string conversionLanguage, string conversionFormat, string conversionColor, string conversionLabel, string conversionValue, string conversionCurrency, bool remarketingOnly) { var googleConversionId = conversionId; var googleConversionLanguage = string.IsNullOrWhiteSpace(conversionLanguage) ? "en" : conversionLanguage; var googleConversionFormat = string.IsNullOrWhiteSpace(conversionFormat) ? "3" : conversionFormat; var googleConversionColor = string.IsNullOrWhiteSpace(conversionColor) ? "ffffff" : conversionColor; var googleConversionLabel = conversionLabel; var googleConversionValue = string.IsNullOrWhiteSpace(conversionValue) ? "0" : conversionValue; var googleConversionCurrency = string.IsNullOrWhiteSpace(conversionCurrency) ? "DKK" : conversionCurrency; var googleRemarketingOnly = remarketingOnly; <!-- Google Code for the Conversion Page --> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = @(googleConversionId); var google_conversion_language = '@(googleConversionLanguage)'; var google_conversion_format = '@(googleConversionFormat)'; var google_conversion_color = '@(googleConversionColor)'; var google_conversion_label = '@(googleConversionLabel)'; var google_conversion_value = @(googleConversionValue); var google_conversion_currency = '@(googleConversionCurrency)'; var google_remarketing_only = @(googleRemarketingOnly ? "true" : "false"); /* ]]> */ </script> <script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js"></script> <noscript> <div style="display: inline;"> <img src="https://www.googleadservices.com/pagead/conversion/@(googleConversionId)/?value=@(googleConversionValue)&amp;currency_code=@(googleConversionCurrency)&amp;label=@(googleConversionLabel)&amp;guid=ON&amp;script=0" alt="" width="1" height="1" style="border-style: none;"> </div> </noscript> } @helper RenderGoogleAnalyticsEcommerceTracking(string transactionId, string affiliation, string revenue, string shipping, string tax, string currency, string[][] orderLines) { <script type="text/javascript"> if (!window.skabertrang_ga_ecommerce_callbacks) window.skabertrang_ga_ecommerce_callbacks = []; (function() { var orderLines = @(Newtonsoft.Json.JsonConvert.SerializeObject(orderLines)); window.skabertrang_ga_ecommerce_callbacks.push(function() { ga('require', 'ecommerce'); ga('ecommerce:addTransaction', { 'id' : '@(transactionId)', 'affiliation' : '@(affiliation)', 'revenue' : '@(revenue)', 'shipping' : '@(shipping)', 'tax' : '@(tax)', 'currency' : '@(currency)' }); if (orderLines && orderLines.length) { for (var i = 0; i < orderLines.length; i++) { ga('ecommerce:addItem', { 'id' : '@(transactionId)', 'name' : orderLines[i][1], 'sku' : orderLines[i][0], 'category' : orderLines[i][2], 'price' : orderLines[i][3], 'quantity' : orderLines[i][4], 'currency' : '@(currency)' }); } } ga('ecommerce:send'); }); })(); </script> } @functions { string mediaOverlay(string filePath, string filePathThumb = "", string caption = "", string group = "", string alt = "", string title = "", string extraAttributes = "") { var pv = Dynamicweb.Frontend.PageView.Current(); var imageOverlayType = pv.Area.Item["ImageOverlayType"] as string; filePathThumb = !string.IsNullOrWhiteSpace(filePathThumb) ? filePathThumb : filePath; group = !string.IsNullOrWhiteSpace(group) ? group : !string.IsNullOrWhiteSpace(GetString("ParagraphID")) ? GetString("ParagraphID") : "imageGroup"; if (imageOverlayType=="Fancybox") { return "<a class='fancybox media-overlay' href='" + filePath + "' rel='" + group + "' title='" + title + "' data-title='" + caption + "'><img src='/Files/Templates/Designs/Default/"+filePathThumb+"' alt='" + alt + "' title='" + title + "'></a>"; } else { return "<a href='" + filePath + "' class='media-overlay' data-lightbox='" + group + "' data-title='" + caption + "'><img src='/Files/Templates/Designs/Default/"+filePathThumb+"' alt='" + alt + "' title='" + title + "'></a>"; } } string GetImage(string image, int width, int height, int compression, int crop, string colorSpace, bool doNotUpscale) { // Crop // 0 = Center // 1 = From upper left // 2 = From lower left // 3 = From lower right // 4 = From upper right // 5 = Keep aspect ratio // 6 = Fit image // ColorSpace // rgb // cmyk // grayscale var param = new List<string>(); param.Add("Image=" + image); param.Add("Format=" + Path.GetExtension(image).Substring(1)); if (width > 0) { param.Add("Width=" + width); } if (height > 0) { param.Add("Height=" + height); } param.Add("Compression=" + compression); param.Add("Crop=" + crop); param.Add("ColorSpace=" + colorSpace); param.Add("DoNotUpscale=" + (doNotUpscale ? "True" : "False")); return "/Admin/Public/GetImage.ashx?" + string.Join("&amp;", param); } string GetImagePlaceholder(int width, int height) { return GetImagePlaceholder(width, height, null, null, null); } string GetImagePlaceholder(int width, int height, string backgroundColor, string textColor, string text) { var r = "https://placehold.it/" + width; if (height > 0) { r += "x" + height; } if (!string.IsNullOrWhiteSpace(backgroundColor) && !string.IsNullOrWhiteSpace(textColor)) { r += "/" + backgroundColor; r += "/" + textColor; } if (!string.IsNullOrWhiteSpace(text)) { r += "?text=" + text.Replace(" ", "+"); } return r; } T LoadContextItem<T>(string key) { var obj = HttpContext.Current.Items != null ? HttpContext.Current.Items[key] : null; if (obj == null) { return default(T); } return (T)obj; } void SaveContextItem(string key, object value) { if (HttpContext.Current.Items != null && value != null) { HttpContext.Current.Items[key] = value; } } string PathCombine(params string[] paths) { return Path.Combine(paths); } string NullIfEmpty(string value) { return string.IsNullOrEmpty(value) ? null : value; } string NullIfWhiteSpace(string value) { return string.IsNullOrWhiteSpace(value) ? null : value; } string ToJson(object value) { return ToJson(value, false); } string ToJson(object value, bool indented) { return Newtonsoft.Json.JsonConvert.SerializeObject( value, indented ? Newtonsoft.Json.Formatting.Indented : Newtonsoft.Json.Formatting.None, new Newtonsoft.Json.Converters.IsoDateTimeConverter { DateTimeFormat = "yyyyMMdd'T'HHmmss" } ); } void AddCssFile(params string[] files) { var list = LoadContextItem<List<string>>("SB.CssFiles"); if (list == null) { list = new List<string>(); } foreach (var file in files) { if (!list.Contains(file, StringComparer.OrdinalIgnoreCase)) { list.Add(file); } } SaveContextItem("SB.CssFiles", list); } void AddJsFile(params string[] files) { var list = LoadContextItem<List<string>>("SB.JsFiles"); if (list == null) { list = new List<string>(); } foreach (var file in files) { if (!list.Contains(file, StringComparer.OrdinalIgnoreCase)) { list.Add(file); } } SaveContextItem("SB.JsFiles", list); } /******************** * Custom functions * ********************/ object[] GetProductPriceInfo(Dictionary<string, object> values) { var price = Dynamicweb.Input.FormatDouble(values["Ecom:Product.DBPrice"]); var priceCurrencyCode = Dynamicweb.Input.FormatString(values["Ecom:Product.Price.CurrencyCode"]); var priceEUR = Dynamicweb.Input.FormatDouble(values["Ecom:Product:Field.ProductCustomPriceEUR.Value.Raw"]); var priceSEK = Dynamicweb.Input.FormatDouble(values["Ecom:Product:Field.ProductCustomPriceSEK.Value.Raw"]); var priceNOK = Dynamicweb.Input.FormatDouble(values["Ecom:Product:Field.ProductCustomPriceNOK.Value.Raw"]); var priceGBP = Dynamicweb.Input.FormatDouble(values["Ecom:Product:Field.ProductCustomPriceGBP.Value.Raw"]); var priceUSD = Dynamicweb.Input.FormatDouble(values["Ecom:Product:Field.ProductCustomPriceUSD.Value.Raw"]); var amount = price; var amountDiscount = 0.0; var amountCurrencyCode = priceCurrencyCode; var disabledAdd = false; if (Pageview.User.LoggedIn) { var user = Dynamicweb.Modules.UserManagement.User.GetCurrentUser(); var userISO = user.CustomFieldValues.Any(cf => cf.CustomField.SystemName == "AccessUser_Isocode") ? (string)user.CustomFieldValues.First(cf => cf.CustomField.SystemName == "AccessUser_Isocode").Value : string.Empty; var userDiscount = user.CustomFieldValues.Any(cf => cf.CustomField.SystemName == "AccessUser_Disc") ? (double)user.CustomFieldValues.First(cf => cf.CustomField.SystemName == "AccessUser_Disc").Value : 0D; if (userISO == "EUR" && priceEUR > 0) { amount = priceEUR; amountCurrencyCode = userISO; } else if (userISO == "SEK" && priceSEK > 0) { amount = priceSEK; amountCurrencyCode = userISO; } else if (userISO == "NOK" && priceNOK > 0) { amount = priceNOK; amountCurrencyCode = userISO; } else if (userISO == "GBP" && priceGBP > 0) { amount = priceGBP; amountCurrencyCode = userISO; } else if (userISO == "USD" && priceUSD > 0) { amount = priceUSD; amountCurrencyCode = userISO; } if (userDiscount > 0) { amountDiscount = amount * (userDiscount / 100.0); amount = amount - amountDiscount; } disabledAdd = ( (userISO == "EUR" && priceEUR <= 0.0) || (userISO == "SEK" && priceSEK <= 0.0) || (userISO == "NOK" && priceNOK <= 0.0) || (userISO == "GBP" && priceGBP <= 0.0) || (userISO == "USD" && priceUSD <= 0.0) ); } return new object[] { amount, amountDiscount, amountCurrencyCode, disabledAdd }; } object[] GetOrderLinePriceInfo(List<LoopItem> loops) { var customPrice = loops.FirstOrDefault(o => o.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "CustomPrice" && !string.IsNullOrWhiteSpace(o.GetString("Ecom:Order:OrderLine.OrderLineField.Value"))); var customCurrency = loops.FirstOrDefault(o => o.GetString("Ecom:Order:OrderLine.OrderLineField.SystemName") == "CustomCurrency" && !string.IsNullOrWhiteSpace(o.GetString("Ecom:Order:OrderLine.OrderLineField.Value"))); if (customPrice != null && customCurrency != null) { double price; double.TryParse(customPrice.GetString("Ecom:Order:OrderLine.OrderLineField.Value"), NumberStyles.Any, CultureInfo.InvariantCulture, out price); var currency = new Dynamicweb.eCommerce.International.Currency(customCurrency.GetString("Ecom:Order:OrderLine.OrderLineField.Value")); return new object[] { price, currency }; } return null; } object[] GetOrderShippingPriceInfo(List<LoopItem> orderLines, string countryCode) { var dict = new Dictionary<string, double[]> { { "UPS-AT", new[] { 108.03, 14.50 } }, // Østrig { "UPS-BE", new[] { 104.30, 14.00 } }, // Belgien { "UPS-CH", new[] { 160.18, 21.50 } }, // Schweiz { "UPS-DE", new[] { 89.40, 12.00 } }, // Tyskland { "UPS-ENG", new[] { 126.65, 17.00 } }, // England { "UPS-FI", new[] { 128.51, 17.25 } }, // Finland { "UPS-FR", new[] { 135.96, 18.25 } }, // Frankrig { "UPS-IRL", new[] { 238.40, 32.00 } }, // Irland { "UPS-IT", new[] { 143.41, 19.25 } }, // Italien { "UPS-LIT", new[] { 193.70, 26.00 } }, // Litauen { "UPS-LUX", new[] { 121.06, 16.25 } }, // Luxembourg { "UPS-NL", new[] { 96.85, 13.00 } }, // Holland { "UPS-NO", new[] { 167.63, 22.50 } }, // Norge { "UPS-PL", new[] { 163.90, 22.00 } }, // Polen { "UPS-SE", new[] { 108.03, 14.50 } }, // Sverige { "UPS-SLO", new[] { 286.83, 38.50 } }, // Slovenien { "UPS-SP", new[] { 160.18, 21.50 } }, // Spanien { "GLS-DK", new[] { 65.00, 8.72 } }, // Danmark }; var key = "GLS-DK"; switch (countryCode.ToLower()) { case "at": case "østrig": case "austria": key = "UPS-AT"; break; case "be": case "belgien": case "belgium": key = "UPS-BE"; break; case "ch": case "schweiz": case "switzerland": key = "UPS-CH"; break; case "de": case "tyskland": case "germany": key = "UPS-DE"; break; case "es": case "spanien": case "spain": key = "UPS-SP"; break; case "fi": case "finland": key = "UPS-FI"; break; case "fr": case "frankrig": case "france": key = "UPS-FR"; break; case "gb": case "storbritannien": case "united kingdom": key = "UPS-ENG"; break; case "ie": case "irland": case "ireland": key = "UPS-IRL"; break; case "it": case "italien": case "italy": key = "UPS-IT"; break; case "lt": case "litauen": case "lithuania": key = "UPS-LIT"; break; case "lu": case "luxemborg": case "luxembourg": key = "UPS-LUX"; break; case "nl": case "holland": case "netherlands": key = "UPS-NL"; break; case "no": case "norge": case "norway": key = "UPS-NO"; break; case "pl": case "polen": case "poland": key = "UPS-PL"; break; case "se": case "sverige": case "sweden": key = "UPS-SE"; break; case "si": case "slovenien": case "slovenia": key = "UPS-SLO"; break; case "dk": case "danmark": case "denmark": key = "GLS-DK"; break; } if (key == null) { return null; } var totalWeight = 0.0; var currency = new Dynamicweb.eCommerce.International.Currency("DKK"); var currencyIdx = 0; foreach (var ol in orderLines) { var quantity = ol.GetDouble("Ecom:Order:OrderLine.Quantity"); var weight = ol.GetDouble("Ecom:Order:OrderLine.Weight"); totalWeight += weight; var priceInfo = GetOrderLinePriceInfo(ol.GetLoop("Order.OrderLineFields")); if (priceInfo != null) { var c = (Dynamicweb.eCommerce.International.Currency)priceInfo[1]; currency = c; } } if (currency.Code != "DKK") { currency = new Dynamicweb.eCommerce.International.Currency("EUR"); currencyIdx = 1; } var customShippingFee = Math.Ceiling(totalWeight / 15.0) * dict[key][currencyIdx]; var customShippingCurrency = currency; var customShippingQuantity = Math.Ceiling(totalWeight / 15.0); var customShippingName = key; return new object[] { customShippingFee, customShippingCurrency, customShippingQuantity, customShippingName, totalWeight }; } } @using System.Text.RegularExpressions @{ // http://emailframe.work //Pageview.Template.SetTag("Title", Pageview.Meta.Title + " | " + Pageview.Area.Title); var designBaseUrl = GetString("Template:DesignBaseUrl"); var areaID = GetString("DwAreaID"); string catalogueUrl = ("/Default.aspx?ID=") + ((areaID == "3") ? "83" : "84"); string websiteUrl = ("/Default.aspx?ID=") + ((areaID == "3") ? "36" : "40"); string productUrl = "/" + ((areaID == "3") ? "da-dk/produkter/plaider.aspx?filters=1&Qualities=Premium_Baby_Alpaca" : "en-gb/webshop/throws.aspx?filters=1&Qualities=Premium_Baby_Alpaca"); ; var pageName = GetString("Item.PageName"); //var logo = GetString("Item.Logo"); var topBanner = GetString("Item.TopBanner"); var backgroundColor = GetString("Item.BackgroundColor"); var textColor = GetString("Item.TextColor"); var headerBGColor = "#ffffff"; var headerTopColor = "#ababab"; //if (string.IsNullOrWhiteSpace(logo)) { // logo = "tytex.png"; //} //if (logo == "cantaloop.png") { // headerBGColor = "#f4e7d9"; //} else if (logo == "carefix.png") { // headerBGColor = "#9b9b9b"; //} else if (logo == "continence-care.png") { // headerBGColor = "#0e1941"; //} else if (logo == "corsinel.png") { // headerBGColor = "#78a1c6"; // headerTopColor = "#ffffff"; //} else if (logo == "safehip.png") { // headerBGColor = "#0e1941"; //} else if (logo == "cantaloop_white.png") { // headerBGColor = "#000000"; //} if (string.IsNullOrWhiteSpace(backgroundColor)) { backgroundColor = "transparent"; } var companyAddress = GetString("Item.Area.Company_Address"); var companyAddress2 = GetString("Item.Area.Company_Address2"); var companyPostal = GetString("Item.Area.Company_Postal"); var companyCity = GetString("Item.Area.Company_City"); var companyCountry = GetString("Item.Area.Company_Country"); var companyEmail = GetString("Item.Area.Company_Email"); var companyPhone = GetString("Item.Area.Company_Phone"); var companyFax = GetString("Item.Area.Company_Fax"); var companyCVR = GetString("Item.Area.Company_CVR"); //var paragraphService = Dynamicweb.Extensibility.ServiceLocator.Current.GetInstance<Dynamicweb.Content.IParagraphService>(); //var paragraphs = paragraphService.GetParagraphsByPageId(Pageview.Page.ID, Dynamicweb.Content.ParagraphSort.ContainerAndSort) var paragraphs = Dynamicweb.Content.Paragraph.GetParagraphsByPageID(Pageview.Page.ID) .Select(o => { if (o.ShowParagraph) { if (o.GlobalID > 0) { return (Dynamicweb.Content.Paragraph.GetParagraphById(o.GlobalID)); } return o; } return null; }) .Where(o => o != null) .Select(o => { Dynamicweb.Content.Items.Item item = Dynamicweb.Content.Items.Item.GetItemById(o.ItemType, o.ItemId); return new { Headline = (string)item["Headline"], HeadlineFormat = (string)item["HeadlineFormat"], Image = (string)item["Image"], ImageRightAligned = (bool)item["ImageRightAligned"], Text = ((string)item["Text"]).Replace("a href=", "a style='color:"+item["TextColor"]+ "; text-decoration: underline;' href="), BackgroundColor = (string)item["BackgroundColor"], TextColor = (string)item["TextColor"] }; }).ToList(); var serverPath = HttpContext.Current.Request.Url.Scheme + "://" + HttpContext.Current.Request.Url.Host; var fontFamily = "'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif"; string titleColor = !string.IsNullOrWhiteSpace(GetString("Item.TitleColour")) ? GetString("Item.TitleColour") : "#60c2d9"; //string headerColor = "#333333"; } @functions { string ResetMarginP(string value) { return value.Replace("<p>", "<p style='margin: 0 0 10px; line-height: 20px;'>".Replace("'", "\"")); } } @if (false) { <div id="content-block">@GetValue("DwContent(contentblock)")</div> } <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>@GetValue("Title")</title> @GetValue("MetaTags") @GetValue("CopyRightNotice") @*<link href="@(Dynamicweb.Context.Current.Request.Url.Scheme)://fonts.googleapis.com/css?family=Heebo:300,400,500" rel="stylesheet" type="text/css">*@ <style type="text/css"> /* CLIENT-SPECIFIC STYLES */ body, table, td, a { -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; } table, td { mso-table-lspace: 0pt; mso-table-rspace: 0pt; } img { -ms-interpolation-mode: bicubic; } /* RESET STYLES */ img { border: 0; outline: none; text-decoration: none; } table { border-collapse: collapse !important; } body { margin: 0 !important; padding: 0 !important; width: 100% !important; } a { text-decoration: none; } /* iOS BLUE LINKS */ a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; font-size: inherit !important; font-family: inherit !important; font-weight: inherit !important; line-height: inherit !important; } /* ANDROID CENTER FIX */ div[style*="margin: 16px 0;"] { margin: 0 !important; } /* MEDIA QUERIES */ @@media all and (max-width: 639px) { .wrapper { width: 320px !important; padding: 0 !important; } .container { width: 300px !important; padding: 0 !important; } .mobile { width: 300px !important; display: block !important; padding: 0 !important; } .img { max-width: 100% !important; width: 100% !important; height: auto !important; } *[class="mobileOff"] { width: 0 !important; display: none !important; } *[class*="mobileOn"] { display: block !important; max-height: none !important; } } /* CUSTOMS */ [style*="Heebo"] { font-family: 'Heebo', Arial, Tahoma, Verdana, sans-serif !important; } </style> @GetValue("Stylesheets") @GetValue("Javascripts") </head> <body style="margin: 0; padding: 0; background-color: @(backgroundColor);" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <center> <table border="0" width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="@(backgroundColor)"> <tr> <td align="center" valign="top"> @* PreHeader *@ <table width="640" cellpadding="0" cellspacing="0" border="0" class="wrapper" bgcolor="@(headerBGColor)" style="width:640px;max-width:640px"> <tr> <td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td> </tr> <tr> <td align="center" valign="top"> <table width="600" cellpadding="0" cellspacing="0" border="0" class="container"> <tr> <td align="left" valign="top" style="font-family: @(fontFamily); font-weight: 300; font-size: 11px; color: @(headerTopColor);"> {{EmailMarketing:Email.PreHeader.Clean}} </td> </tr> </table> </td> </tr> <tr> <td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td> </tr> </table> @* Head *@ <table width="640" cellpadding="0" cellspacing="0" border="0" class="wrapper" bgcolor="@(headerBGColor)" style="width:640px;max-width:640px"> <tr> <td height="30" style="font-size: 10px; line-height: 10px;">&nbsp;</td> </tr> <tr> <td align="center" valign="top"> <table width="600" cellpadding="0" cellspacing="0" border="0" class="container"> <tr> <td class="mobile" align="center" valign="middle"> <img src="@(serverPath)@(designBaseUrl)img/logo.png" style="margin: 0; padding: 0; border: none; display: block;" border="0" alt=""> </td> @*<td class="mobile" align="right" valign="bottom" style="font-family: @(fontFamily);"> <h3 style="font-size: 20px; font-weight: 500; color: @(titleColor); line-height: 1; margin: 0; padding: 0; text-transform: uppercase;">@(pageName)</h3> </td>*@ </tr> </table> </td> </tr> <tr> <td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td> </tr> <tr> <td valign="middle" style="padding: 10px 0 10px; border-top: 1px solid #8b8b8a;border-bottom: 1px solid #8b8b8a;"> <table width="640" cellpadding="0" cellspacing="0" border="0"> <tr> <td width="220" valign="middle" class="mobile" align="right" style="font-family: @(fontFamily);"> <a href="@catalogueUrl" style="font-size: 15px; font-weight: 500; color: @(titleColor); line-height: 15px; margin: 0; padding: 0; text-transform: uppercase;" target="_blank">@Translate("catalogue")</a> </td> <td width="180" valign="middle" class="mobile" align="center" style="font-family: @(fontFamily);"> <a href="@websiteUrl" style="font-size: 15px; font-weight: 500; color: @(titleColor); line-height: 15px; margin: 0; padding: 0; text-transform: uppercase;" target="_blank">@Translate("websitePage")</a> </td> <td width="220" valign="middle" class="mobile" align="left" style="font-family: @(fontFamily);"> <a href="@productUrl" style="font-size: 15px; font-weight: 500; color: @(titleColor); line-height: 15px; margin: 0; padding: 0; text-transform: uppercase;" target="_blank">@Translate("products")</a> </td> </tr> </table> </td> </tr> @*<tr> <td align="center" valign="top"> <table width="600" cellpadding="0" cellspacing="0" border="0" class="container"> <tr> <td align="right" valign="top" style="font-family: @(fontFamily); font-size: 9px; text-transform: uppercase;"> <a href="@(serverPath)/Default.aspx?Id=@(Pageview.Page.ID)" style="color: @(headerTopColor); text-decoration: none;">@(Translate("View in browser"))</a> </td> </tr> </table> </td> </tr>*@ <tr> <td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td> </tr> <tr> <td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td> </tr> </table> @if (!string.IsNullOrWhiteSpace(topBanner)) { <table width="640" cellpadding="0" cellspacing="0" border="0" class="wrapper" bgcolor="#ffffff" style="width:640px;max-width:640px"> <tr> <td align="center" valign="top"> <img src="@(serverPath)@(topBanner)" style="margin: 0; padding: 0; border: none; display: block; max-width: 100%; height: auto; width: 100%; max-width: 640px;" border="0" class="img" alt=""> </td> </tr> </table> } @{ var isH1Exists = paragraphs.Any(o => !string.IsNullOrWhiteSpace(o.Headline) && o.HeadlineFormat == "h1"); var colorGray = "#f4f3ef"; var colorWhite = "#ffffff"; } @foreach (var item in paragraphs) { <table width="640" cellpadding="0" cellspacing="0" border="0" class="wrapper" bgcolor="@(!string.IsNullOrWhiteSpace(item.BackgroundColor) ? item.BackgroundColor : colorWhite)" style="width:640px;max-width:640px"> <tr> <td height="20" style="font-size: 20px; line-height: 20px;">&nbsp;</td> </tr> <tr> <td align="center" valign="top"> @if (string.IsNullOrWhiteSpace(item.Image)) { <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" style="width:600px;max-width:600px"> <tr> <td align="left" valign="top" style="font-family: @(fontFamily); font-weight: 400; font-size: 14px; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"=""> @if (!isH1Exists && !string.IsNullOrWhiteSpace(item.Headline) && string.IsNullOrWhiteSpace(item.HeadlineFormat)) { isH1Exists = true; <h1 style="font-size: 24px; font-weight: 600; line-height: 1.2; margin: 0 0 5px;; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h1> } else if (isH1Exists && !string.IsNullOrWhiteSpace(item.Headline) && string.IsNullOrWhiteSpace(item.HeadlineFormat)) { <h2 style="font-size: 22px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h2> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h1") { <h1 style="font-size: 24px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h1> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h2") { <h2 style="font-size: 22px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h2> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h3") { <h3 style="font-size: 20px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h3> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h4") { <h4 style="font-size: 18px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h4> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h5") { <h5 style="font-size: 16px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h5> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h6") { <h6 style="font-size: 14px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h6> } @(ResetMarginP(item.Text ?? string.Empty)) </td> </tr> </table> } else { <table width="600" cellpadding="0" cellspacing="0" border="0" class="container" style="width:600px;max-width:600px"> <tr> @if (!item.ImageRightAligned) { <td class="mobile" align="left" valign="top" width="200"> <img src="@(serverPath)@(item.Image)" style="margin: 0; padding: 0; border: none; display: block; width: 100%; max-width: 200px; height: auto;" border="0" class="img" alt=""> </td> <td class="mobileOff" width="15">&nbsp;</td> } <td class="mobile" align="left" valign="top" width="375" style="font-family: @(fontFamily); font-weight: 400; font-size: 14px; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"=""> @if (!isH1Exists && !string.IsNullOrWhiteSpace(item.Headline) && string.IsNullOrWhiteSpace(item.HeadlineFormat)) { isH1Exists = true; <h1 style="font-size: 24px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h1> } else if (isH1Exists && !string.IsNullOrWhiteSpace(item.Headline) && string.IsNullOrWhiteSpace(item.HeadlineFormat)) { <h2 style="font-size: 22px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h2> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h1") { <h1 style="font-size: 24px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h1> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h2") { <h2 style="font-size: 22px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h2> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h3") { <h3 style="font-size: 20px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h3> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h4") { <h4 style="font-size: 18px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h4> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h5") { <h5 style="font-size: 16px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h5> } else if (!string.IsNullOrWhiteSpace(item.Headline) && item.HeadlineFormat == "h6") { <h6 style="font-size: 14px; font-weight: 500; line-height: 1.2; margin: 0; padding: 0; color: @(!string.IsNullOrWhiteSpace(item.TextColor) ? item.TextColor : " #333333");"="">@(item.Headline)</h6> } @(ResetMarginP(item.Text ?? string.Empty)) </td> @if (item.ImageRightAligned) { <td class="mobileOff" width="15">&nbsp;</td> <td class="mobile" align="right" valign="top" width="200"> <img src="@(serverPath)@(item.Image)" style="margin: 0; padding: 0; border: none; display: block; width: 100%; max-width: 200px; height: auto;" border="0" class="img" alt=""> </td> } </tr> </table> } </td> </tr> <tr> <td height="20" style="font-size: 20px; line-height: 20px;">&nbsp;</td> </tr> </table> } @* Footer *@ <table width="640" cellpadding="0" cellspacing="0" border="0" class="wrapper" bgcolor="#ffffff" style="width:640px;max-width:640px"> <tr> <td align="center" valign="top"> </td><td height="20" style="font-size: 20px; line-height: 20px;">&nbsp;</td> </tr> </table> <table width="640" cellpadding="0" cellspacing="0" border="0" class="wrapper" bgcolor="#ffffff" style="border-top: 1px dashed #8b8b8a;"> <tr> <td height="20" style="font-size: 20px; line-height: 20px;">&nbsp;</td> </tr> <tr> <td align="center" valign="top"> </td></tr><tr> <td class="mobile" align="center" valign="bottom" style="font-family: @(fontFamily);font-size: 10px;"> <h2 style="margin: 0 0 0px;color: #333333;">Silkeborg Uldspinderi</h2> </td> </tr> <td align="center" valign="top"> <table width="640" cellpadding="0" cellspacing="0" border="0" class="container"> <tr> <td class="mobile" align="left" valign="bottom" style="font-family: @(fontFamily); font-size: 10px; color: #333333;"> @*<img src="@(serverPath)@(designBaseUrl)img/logo.png" width="94" height="23" style="margin: 0 0 5px; padding: 0; border: none; display: block;" border="0" alt="">*@ @*<h2 style="margin: 0 0 5px;color: #333333;">Silkeborg Uldspinderi</h2>*@ <p style="margin: 0;"> Vandværksvej 10 &nbsp;|&nbsp; DK-8620 Kjellerup &nbsp;| Tel. <a href="tel:+4586881738" style="color: #333333; text-decoration: none;">+45 86 88 17 38</a> &nbsp;|&nbsp; Email <a href="mailto:info@silkeborg-uld.com" style="color: #333333; text-decoration: none;">info@silkeborg-uld.com</a> @*Tytex A/S*@ @*@if (!string.IsNullOrWhiteSpace(companyAddress)) { @:&#183; @(companyAddress) } @if (!string.IsNullOrWhiteSpace(companyAddress2)) { @:&#183; @(companyAddress2) } @if (!string.IsNullOrWhiteSpace(companyPostal) && !string.IsNullOrWhiteSpace(companyCity)) { @:&#183; @(companyPostal + " " + companyCity) } @if (!string.IsNullOrWhiteSpace(companyCountry)) { @:&#183; @(companyCountry) } @if (!string.IsNullOrWhiteSpace(companyPhone)) { var href = Regex.Replace(companyPhone, "[^0-9+]", string.Empty); @:&#183; <a href="tel:@(href)" style="color: #ffffff; text-decoration: none;">@(companyPhone)</a> }*@ @*@if (!string.IsNullOrWhiteSpace(companyFax)) { var href = Regex.Replace(companyFax, "[^0-9+]", string.Empty); @:&#183; @(Translate("Fax")) <a href="fax:@(href)">@(companyFax)</a> } @if (!string.IsNullOrWhiteSpace(companyEmail)) { @:&#183; <a href="mailto:@(companyEmail)">@(companyEmail)</a> } @if (!string.IsNullOrWhiteSpace(companyCVR)) { @:&#183; @(Translate("CVR.")): @(companyCVR) } *@ </p> </td> <td class="mobile" align="right" valign="bottom" style="font-family: @(fontFamily); font-size: 10px;"> @*<a href="https://www.linkedin.com/company/96614" target="_blank" style="color: #333333; text-decoration: none; display: block;"> <img src="@(serverPath)@(designBaseUrl)img/mail/logo-linkedin.png" width="21" height="21" style="margin: 0 0 5px; padding: 0; border: none; display: block;" border="0" alt=""> <p style="margin: 0;">Follow us on LinkedIn</p> </a>*@ <a href="https://www.instagram.com/silkeborg_uldspinderi/?hl=da" target="_blank" style="color: #333333; text-decoration: none;"> <p style="margin: 0;">@Translate("Følg os på Instagram")</p> @*<img src="@(serverPath)/Files/Files/instIcon.png" width="21" height="21" style="margin: 0 0 0px; padding: 0; border: none;display:inline-block" border="0" alt="">*@ </a> </td> <td class="mobile" align="right" valign="bottom" style="padding-left:10px;font-family: @(fontFamily); font-size: 10px;"> <a href="https://www.instagram.com/silkeborg_uldspinderi/?hl=da" target="_blank" style="color: #333333; text-decoration: none;"> <img src="@(serverPath)/Files/Files/instIcon.png" width="21" height="21" style="margin: 0 0 0px; padding: 0; border: none;" border="0" alt=""> </a> </td> </tr> </table> </td> <tr> <td height="20" style="font-size: 20px; line-height: 20px;">&nbsp;</td> </tr> </table> @* Unsubscribe *@ <table width="640" cellpadding="0" cellspacing="0" border="0" class="wrapper" bgcolor="#ffffff"> <tr> <td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td> </tr> <tr> <td align="center" valign="top"> <table width="600" cellpadding="0" cellspacing="0" border="0" class="container"> <tr> <td align="center" valign="top" style="font-family: @(fontFamily); font-weight: 300; font-size: 11px;"> <a href="{{EmailMarketing:Email.UnsubscribeLink.Clean}}" style="color: #626262; text-decoration: none;">@(Translate("Unsubscribe"))</a> </td> </tr> </table> </td> </tr> <tr> <td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td> </tr> </table> </td></tr></table> </center> {{EmailMarketing:Email.TrackingImage}} </body> </html>