Skip to content

Instantly share code, notes, and snippets.

@saurabhpati
Created November 20, 2018 09:04
Show Gist options
  • Save saurabhpati/150af34e4ad45de965147136d3a4a6d1 to your computer and use it in GitHub Desktop.
Save saurabhpati/150af34e4ad45de965147136d3a4a6d1 to your computer and use it in GitHub Desktop.
c# create table function
private static StringBuilder CreateTableHeader()
{
StringBuilder s = new StringBuilder();
//s.AppendLine("<html>");
//s.AppendLine("<head>");
//s.AppendLine("<meta charset=\"UTF - 8\">");
//s.AppendLine("<meta name=\"viewport\" content=\"width = device - width, initial - scale = 1, maximum - scale = 1\">");
//s.AppendLine("<style>body { padding: 0; margin: 0; }</style>");
//s.AppendLine("</head>");
//s.AppendLine("<body>");
s.AppendLine("<div class=\"emailer\" style=\"background: #f4f4f4;padding: 30px;box-sizing: border-box;\">");
s.AppendLine("<div class=\"emailer-content\" style=\"background: #FFF;max-width: 700px;min-width: 400px;margin: auto;box-shadow: 0px 5px 5px rgba(0,0,0,0.1);box-sizing: border-box;\">");
s.AppendLine("<div class=\"emailer - header\" style=\"display: flex; background: #ab447a;padding: 20px;\">");
s.AppendLine("<div class=\"emailer - logo\">");
s.AppendLine("<svg style=\"width: 100px; height: auto; \"version=\"1.1\" id=\"Layer_1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" width=\"173.93px\" height=\"83.046px\" viewBox=\"0 0 173.93 83.046\" enable-background=\"new 0 0 173.93 83.046\" xml:space=\"preserve\">");
s.AppendLine("<path fill=\"#FFFFFF\" d=\"M2.402,18.426C2.402,2.864,16.548,0,22.443,0c4.61,0,7.245,0.924,8.704,1.588c0.683, 0.311, 0.906, 0.432, 0.906, 0.907v7.087c0, 0.974-0.135, 0.965-0.906, 0.572c-1.215-0.616-3.439-1.688-7.112-1.688c-7.417, 0-12.104, 3.944-12.104, 10.562c0, 8.006, 4.466, 11.406, 8.925, 11.406c1.58, 0, 2.426-0.41, 2.811-0.643c0.39-0.235, 0.525-0.376, 0.525-0.921v-7.548c0-1.113-0.163-1.546-0.581-2.657c-0.414-1.11-0.341-1.437, 0.886-1.437h7.612c1.46, 0, 1.253, 0, 1.253, 1.297v14.442c0, 1.11-0.346, 1.206-1.092, 1.569c-1.072, 0.517-6.082, 1.808-10.599, 1.808C14.802, 36.345, 2.402, 33.985, 2.402, 18.426z M47.591, 34.773v-7.094c0-3.243, 0.392-5.321, 1.287-7.072c2.138-4.183, 9.447-10.118, 17.141-10.118c5.411, 0, 8.04, 3.514, 8.04, 10.588c0, 6.366-2.534, 8.951-6.604, 8.951c-2.208, 0-4.104-1.095-4.557-3.621c-0.641-3.604, 1.826-5.932, 4.59-5.932c1.809, 0, 2.856, 0.625, 3.343, 0.886c0.466, 0.25, 0.624, 0.195, 0.551-0.231c-0.128-0.772-0.353-2.235-0.732-3.718c-0.187-0.726-0.271-0.916-0.854-1.172c-0.57-0.249-1.493-0.542-2.657-0.542c-6.329, 0-13.021, 4.246-13.021, 11.567c0, 6.458, 4.748, 8.908, 10.674, 8.908c4.427, 0, 7.98-1.805, 8.734-2.282c0.542-0.338, 0.661-0.437, 0.661, 0.47c0, 0.005, 0, 0.013, 0, 0.019v7.075v0.012v0.236c0, 1.097, 0.102, 1.208, 1.142, 1.208h5.694c0.93, 0, 1.088, 0.109, 1.088-1.154v-9.537c0-13.273, 4.989-20.522, 10.089-20.522c3.313, 0, 5.412, 3.184, 5.412, 9.098c0, 5.341-2.162, 8.028-5.304, 8.028c-3.286, 0-4.485-1.537-5.144-2.828c-0.191-0.375-0.413-0.371-0.646, 0.164c-0.441, 1.021-1.558, 3.794-1.957, 4.869c-0.206, 0.548-0.103, 0.82, 0.151, 1.203c1.669, 2.519, 4.968, 3.941, 9.127, 3.941c7.562, 0, 12.317-6.367, 12.317-14.597c0-11.525-5.964-15.805-12.383-15.805c-5.727, 0-9.954, 2.156-12.993, 5.585c-0.025, 0.024-0.047, 0.042-0.072, 0.07c-0.276, 0.336-0.565, 0.655-0.867-0.004c-0.849-1.873-2.653-5.708-12.906-5.708c-7.353, 0-14.617, 2.69-18.288, 4.79c-0.826, 0.468-1.058, 0.626-1.058-0.188V7.199c0-0.989-0.604-0.908-1.385-0.908H38.71c-1.01, 0-1.051, 0.578-0.813, 1.234c0.229, 0.661, 0.68, 2.223, 0.68, 3.952v23.068c0, 0.927, 0.2, 1.09, 0.789, 1.09h7.311C47.415, 35.636, 47.591, 35.268, 47.591, 34.773z M124.921, 36.392c3.828, 0, 6.115-0.638, 6.937-0.987c0.516-0.221, 0.579-0.335, 0.822-1.024c0.307-0.88, 0.816-2.553, 1.25-4.135c0.172-0.629-0.153-0.769-0.623-0.551c-1.424, 0.665-4.111, 1.207-7.974, 1.207c-5.384, 0-9.733-2.96-9.733-9.654c0-6.106, 3.313-9.552, 6.938-9.552c3.315, 0, 5.279, 1.72, 5.279, 4.503c0, 2.963-1.56, 4.061-3.107, 4.061c-1.748, 0-2.979-1.243-3.308-1.757c-0.448-0.692-0.606-0.694-0.937, 0c-0.619, 1.317-1.3, 3.069-1.646, 4.046c-0.297, 0.835-0.303, 0.943, 0.361, 1.843c1.051, 1.43, 3.564, 3.002, 7.393, 3.002c6.871, 0, 9.84-5.306, 9.84-9.879c0-6.896-4.922-11.743-13.358-11.743c-7.894, 0-14.912, 5.5-14.912, 14.265C108.142, 30.025, 113.319, 36.392, 124.921, 36.392z M23.732, 60.533c-7.337-2.258-9.708-3.253-9.708-5.834c0-2.041, 2.932-4.125, 9.541-4.125c5.789, 0, 10.097, 1.684, 12.406, 3.436c0.511, 0.383, 0.864, 0.273, 0.864-0.379v-8.771c0-0.619-0.248-0.807-1.018-1.175c-1.144-0.545-5.42-2.524-13.896-2.524c-9.938, 0-19.552, 3.621-19.552, 12.88c0, 8.326, 6.628, 10.117, 14.41, 12.56c5.082, 1.595, 10.685, 2.876, 10.685, 5.698c0, 2.42-1.776, 3.768-9.418, 3.768c-5.598, 0-11.989-2.23-13.772-3.211c-0.769-0.423-1.027-0.309-1.027, 0.292v5.901c0, 0.943, 0.129, 1.043, 1.123, 1.396c1.285, 0.451, 6.123, 2.521, 17.115, 2.521c10.837, 0, 17.479-4.207, 17.479-10.662C38.964, 65.843, 33.056, 63.402, 23.732, 60.533z M173.646, 40.461c-1.93, 3.449-6.251, 10.003-11.54, 6.992c-0.849-0.481-1.353-0.293-1.61, 0.656c-1.479, 5.543-4.855, 9.508-10.938, 12.223c0.262, 1.582, 0.399, 3.256, 0.399, 5.033c0, 13.748-10.633, 17.579-24.813, 17.579c-0.691, 0-1.338, 0-1.95-0.002c-7.667-0.028-9.534-0.246-10.856-0.364c-1.319-0.119-1.879-0.6-1.879-2.041v-14.94c-7.915, 0.325-17.248, 0.674-26.084, 0.989c1.439, 7.949, 6.57, 10.74, 14.322, 11.348c1.578, 0.12, 4.303, 0.12, 5.914, 0.041c0.787-0.033, 0.957-0.014, 0.873, 0.585c-0.153, 1.101-0.572, 2.45-0.819, 3.401c-0.13, 0.51-0.27, 0.75-0.861, 0.848c-1.257, 0.205-4.558, 0.324-8.378, 0.16c-10.983-0.461-19.738-4.928-21.877-16.002c-11.27, 0.392-19.973, 0.675-20.852, 0.717c-0.492, 0.021-0.602, 0.174-0.51, 0.542c1.824, 6.7, 6.762, 9.146, 13.955, 9.708c1.575, 0.12, 4.3, 0.12, 5.911, 0.041c0.786-0.033, 0.961-0.014, 0.873, 0.585c-0.152, 1.101-0.571, 2.45-0.815, 3.401c-0.137, 0.51-0.273, 0.75-0.866, 0.848c-1.253, 0.205-4.554, 0.324-8.376, 0.16c-12.674-0.532-22.38-6.389-22.38-21.573c0-13.745, 10.981-18.701, 21.315-19.203c4.957-0.243, 9.037, 0.442, 9.801, 0.739c0.343, 0.136, 0.375, 0.427, 0.211, 0.949c-0.373, 1.191-0.945, 4.156-1.664, 6.063c-0.193, 0.499-0.447, 0.513-0.873, 0.331c-1.134-0.488-2.312-0.835-4.735-0.835c-6.22, 0-12.09, 2.526-13.012, 9.942c-0.03, 0.258, 0.2, 0.297, 0.618, 0.306c4.581, 0.079, 12.244, 0.144, 20.948, 0.192c0.779-12.594, 11.32-17.207, 21.263-17.689c4.96-0.243, 9.039, 0.441, 9.802, 0.739c0.346, 0.136, 0.375, 0.427, 0.21, 0.948c-0.374, 1.192-0.942, 4.158-1.664, 6.064c-0.189, 0.499-0.449, 0.514-0.874, 0.331c-1.132-0.487-2.308-0.835-4.732-0.835c-6.374, 0-12.381, 2.652-13.072, 10.495c9.297, 0.042, 18.801, 0.067, 26.43, 0.085V47.164c-0.117-1.617-0.52-3.006-0.745-3.646c-0.267-0.752-0.22-1.41, 0.932-1.41h6.428c1.827-0.054, 3.953-0.045, 6.122, 0.025c2.663, 0.086, 5.383, 0.271, 7.667, 0.552c8.602, 1.051, 15.146, 5.858, 17.803, 13.978c5.308-2.058, 8.61-4.943, 9.652-8.352c0.391-1.271-1.01-1.443-2.068-0.793c-3.266, 1.996-7.547-1.292-10.498-7.341c-0.546-1.116-1.147-1.475, 0.742-1.565c5.79-0.274, 10.341, 1.849, 10.885, 5.084c0.103, 0.604, 0.31, 1.057, 0.584, 1.401c0, 0.004, 0.009, 0.007, 0.01, 0.01c0.267, 0.353, 0.523, 0.149, 0.578-0.144c0.242-1.305-0.178-2.783-0.952-3.998c-0.326-0.506-0.725-0.874-0.992-1.009c-1.937-0.962-2.339-2.287-1.965-5.071c0.118-0.883-1.128-3.079-0.177-2.518c1.431, 0.842, 2.349, 1.887, 2.936, 2.921c0.246, 0.432, 0.293, 0.75, 0.359-0.019c0.084-0.945, 0.14-1.265, 0.785-0.001c1.078, 2.098, 0.206, 3.649, 0.142, 3.887c-0.115, 0.417-0.056, 0.743, 0.104, 1.108c0.495, 1.133, 0.909, 2.445, 1.154, 3.555c0.309-3.986, 1.947-5.517, 4.617-9.333c2.101-3, 2.487-6.691, 0.357-7.202c-1.657-0.396-2.839, 0.726-3.253, 1.81c-0.135, 0.353-0.313, 0.179-0.268-0.192c0.187-1.434, 2.014-2.622, 3.864-2.051c2.723, 0.838, 1.938, 5.021-0.032, 7.945c-2.035, 3.017-4.38, 5.476-4.486, 10.285c-0.014, 0.512, 0.098, 0.86, 0.236, 0.946c0.829-0.144-0.471-2.269, 3.412-5.395c2.934-2.361, 7.396-1.586, 8.375-1.377C173.749, 39.464, 174.297, 39.296, 173.646, 40.461zM120.534, 60.042c2.692, 0.004, 4.562, 0.006, 5.291, 0.006c4.742, 0, 9.014-0.303, 12.792-0.867c-1.069-3.333-3.104-5.947-6.414-7.563c-2.519-1.227-6.177-1.594-9.01-1.67c-0.444-0.012-0.87-0.019-1.265-0.019c-0.896, 0-1.396, 0.221-1.396, 0.881L120.534, 60.042L120.534, 60.042z M139.56, 65.976c0-0.918-0.045-1.811-0.127-2.67c-4.113, 0.771-8.907, 1.299-14.476, 1.617c-1.278, 0.07-2.768, 0.146-4.424, 0.226v11.329c0, 1.23, 0.201, 1.438, 1.396, 1.438h1.265h3.319C135.646, 77.916, 139.56, 71.96, 139.56, 65.976z M1.222, 39.66h0.681v-2.74h1.219v-0.51H0v0.51h1.223l0, 0V39.66z M3.797, 39.66h0.642l-0.026-2.684H4.42l1.191, 2.684h0.584l1.201-2.684h0.008L7.379, 39.66h0.644v-3.25H7.047l-1.131, 2.522L4.78, 36.41H3.797l0, 0V39.66z\"/>");
s.AppendLine("</svg>");
s.AppendLine("</div>");
s.AppendLine("<div class=\"emailer-name\" style=\"flex: 1; padding: 0 20px; display: flex; align-items: center; justify-content: center; color: #FFF;font-family: Arial, sans-serif;font-size: 25px;letter-spacing: 0.4px;\">Localizer Notification</div>");
s.AppendLine("</div>");
s.AppendLine("<div class=\"emailer-body\" style=\"box-sizing: border-box; padding: 45px 45px 60px; background: #FFF; font-size: 16px; font-family: Arial, sans-serif; color: #6d6d6d;\">");
s.AppendLine("<div class=\"emailer-body-title\" style=\"font-family: Arial, sans-serif; text-align: center; box-sizing: border-box; font-size: 21px; margin-bottom: 45px; color: #4a4a4a;\">Updates on Localizer</div>");
s.AppendLine("<table style=\"width: 100%; border: 2px solid #DDD;\" cellpadding=\"0\" colspacing=\"0\">");
s.AppendLine("<thead>");
s.AppendLine("<tr>");
//s.AppendLine("<th style=\"text-align: left; padding: 8px; background: #EEE; color: #5d5d5d; font-size: 14px; text-transform: uppercase;\">Translation Type</th>");
s.AppendLine("<th style=\"text-align: left; padding: 8px; background: #EEE; color: #5d5d5d; font-size: 14px; text-transform: uppercase;\">Language</th>");
s.AppendLine("<th style=\"text-align: left; padding: 8px; background: #EEE; color: #5d5d5d; font-size: 14px; text-transform: uppercase;\">Created</th>");
s.AppendLine("<th style=\"text-align: left; padding: 8px; background: #EEE; color: #5d5d5d; font-size: 14px; text-transform: uppercase;\">Updated</th>");
s.AppendLine("<th style=\"text-align: left; padding: 8px; background: #EEE; color: #5d5d5d; font-size: 14px; text-transform: uppercase;\">Published</th>");
s.AppendLine("</tr>");
s.AppendLine("</thead>");
s.AppendLine("<tbody>");
s.AppendLine("{{rows}}");
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment