You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

241 lines
14 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace EasyBL.WEBAPP.ShowEasy
{
class EmailTemplate_CH
{
public string MailHeader() {
StringBuilder sb = new StringBuilder();
sb.Append("<!DOCTYPE html>");
sb.Append("<html lang=\"zh-tw\" xmlns = \"http://www.w3.org/1999/xhtml\" xmlns: o = \"urn:schemas-microsoft-com:office:office\" xmlns: v = \"urn:schemas-microsoft-com:vml\"> ");
//Head
sb.Append("<head>");
sb.Append("<meta charset=\"utf-8\" />");
sb.Append("<meta name=\"viewport\" content=\"width = device-width\" />");
sb.Append("<meta http-equiv=\"X-UA-Compatible\" content=\"IE = edge\" />");
sb.Append("<meta name=\"x-apple-disable-message-reformatting\" />");
sb.Append("<meta name = \"format-detection\" content = \"telephone=no,address=no,email=no,date=no,url=no\" /> ");
return sb.ToString();
}
public string MailCSS()
{
StringBuilder sb = new StringBuilder();
//CSS Reset Style
sb.Append("<style>");
sb.Append("html,body {margin: 0 auto !important;padding: 0 !important;height: 100% !important;width: 100% !important;}");
//Stops email clients resizing small text
sb.Append("* {-ms-text-size-adjust: 100 %;-webkit-text-size-adjust: 100%;}");
//Centers email on Android 4.4
sb.Append("div[style*=\"margin: 16px 0\"] {margin: 0!important;}");
//Stops Outlook from adding extra spacing to tables
sb.Append("table,td {mso-table-lspace: 0pt !important;mso-table-rspace: 0pt !important;}");
sb.Append("table {border: 0;border-spacing: 0;border-collapse: collapse;}");
//Forces Samsung Android mail clients to use the entire viewport.
sb.Append("#MessageViewBody,#MessageWebViewDiv {width: 100% !important;}");
sb.Append("img {-ms-interpolation-mode: bicubic;}");
//Prevents Windows 10 Mail from underlining links despite inline CSS. Styles for underlined links should be inline.
sb.Append("a {text-decoration: none;}");
//A work-around for email clients automatically linking certain text strings.
sb.Append("a[x-apple-data-detectors],.unstyle-auto-detected-links a,.aBn {border - bottom: 0 !important;cursor: default !important;color: inherit !important;text-decoration: none !important;font - size: inherit !important;font-family: inherit !important;font-weight: inherit !important;line-height: inherit !important;}");
//Gmail、Samsung Mail
sb.Append("u + #body a,#MessageViewBody a{color: inherit;text-decoration: none;font-size: inherit;font-family: inherit;font-weight: inherit;line-height: inherit;}");
//Prevents Gmail from changing the text color in conversation threads.
sb.Append(".im {color: inherit !important;}");
//Prevents Gmail from displaying an download button on large, non-linked images
sb.Append(".a6S {display: none !important;opacity: 0.01 !important;}");
//If the above doesn't work, add a .g-img class to any image in question.
sb.Append("img.g-img + div {display: none !important;}");
//RWD
//Removes right gutter in Gmail iOS app: https://github.com/TedGoas/Cerberus/issues/89
//Create one of these media queries for each additional viewport size you'd like to fix
sb.Append("@media only screen and (min-device-width: 320px) and (max-device-width: 374px) {u ~ div.email-container {min-width: 320px !important;}}");
sb.Append("@media only screen and (min-device-width: 375px) and (max-device-width: 413px) {u ~ div.email-container {min-width: 375px !important;}}");
sb.Append("@media only screen and (min-device-width: 414px) {u ~ div.email-container {min-width: 414px !important;}");
sb.Append("</style>");
//CSS Style
//Hover styles for buttons and tags
sb.Append("<style>");
sb.Append(".s-btn__primary:hover {backgbackground: #eff0f1 !important;border-color: #eff0f1 !important;}");
sb.Append(".s-btn__outlined:hover {background: rgba(0, 119, 204, 0.05) !important;color: #faae69 !important;}");
sb.Append(".s-tag:hover,.post-tag:hover {border-color: #cee0ed !important;}");
//Styles markdown links that we can't write inline CSS for
sb.Append(".has-markdown a,.has-markdown a: visited {color: #0077cc !important;text-decoration: none!important;}");
//Styles markdown code blocks that we can't write inline CSS for
sb.Append("code {padding: 1px 5px;background-color: #eff0f1;color: #242729;font-size: 13px;line-height: inherit;font-family: Consolas, Menlo, Monaco, Lucida Console, Liberation Mono,DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace,sans-serif;}");
sb.Append("pre {margin: 0 0 15px;line-height: 17px;background-color: #eff0f1;padding: 4px 8px;border-radius: 3px;overflow-x: auto;}");
sb.Append("pre code {margin: 0 0 15px;padding: 0;line-height: 17px;background-color: none;}");
//Styles markdown blockquotes that we can't write inline CSS for
sb.Append("blockquote {margin: 0 0 15px;padding: 4px 10px;background-color: #fff8dc;border-left: 2px solid #ffeb8e;}");
sb.Append("blockquote p {padding: 4px 0;margin: 0;overflow-wrap: break-word;}");
//Rounds corners in email clients that support it
sb.Append(".bar {border-radius: 16px;}");
sb.Append(".btr {border-top-left-radius: 16px;border-top-right-radius: 16px;}");
sb.Append(".bbr {border-bottom-left-radius: 5px;border-bottom-right-radius: 5px;}");
sb.Append("@media screen and (max-width: 500px) {");
//Forces table cells into full-width rows
sb.Append(".stack-column,.stack-column-center {display: block!important;width: 100 % !important;max-width: 100 % !important;direction: ltr!important;}");
//And center justify these ones
sb.Append(".stack-column-center {text-align: center !important;}");
//Hides things in small viewports
sb.Append(".hide-on-mobile {display: none!important;max-height: 0 !important;overflow: hidden !important;visibility: hidden !important;}");
//Utility classes to reduce spacing for smaller viewports
sb.Append(".sm-p-none {padding: 0!important;}");
sb.Append(".sm-pt-none {padding-top: 0!important;}");
sb.Append(".sm-pb-none {padding-bottom: 0!important;}");
sb.Append(".sm-pr-none {padding-right: 0!important;}");
sb.Append(".sm-pl-none {padding-left: 0!important;}");
sb.Append(".sm-px-none {padding-left: 0!important;padding-right: 0!important;}");
sb.Append(".sm-py-none {padding-top: 0 !important;padding-bottom: 0!important;}");
sb.Append(".sm-pr {padding-right: 50px !important;}");
sb.Append(".sm-pl {padding-left: 50px !important;}");
sb.Append(".sm-px {padding-left: 50px !important;padding-right: 50px!important;}");
sb.Append(".sm-py {padding-top: 50px !important;padding-bottom: 50px!important;}");
sb.Append("*/ .sm-mb {margin-bottom: 50px !important;}");
//Utility classes to kill border radius for smaller viewports. Used mainly on the email's main container(s)
sb.Append(".bar,.btr,.bbr {border-top-left-radius: 0;border-top-right-radius: 0;border-bottom-left-radius: 0;border-bottom-right-radius: 0;}");
sb.Append("}");
sb.Append("</style>");
sb.Append("</head>");
return sb.ToString();
}
public string MailShowEasyLogo() {
StringBuilder sb = new StringBuilder();
//BODY
//The email background color is defined in three places, just below. If you change one, remember to change the others.
//1. body tag: for most email clients
//2. center tag: for Gmail and Inbox mobile apps and web versions of Gmail, GSuite, Inbox, Yahoo, AOL, Libero, Comcast, freenet, Mail.ru, Orange.fr
//3. mso conditional: For Windows 10 Mail
sb.Append("<body width = \"100%\" style = \"margin: 0;padding: 0!important;background: #f8f8f8;mso-line-height-rule: exactly;\"> ");
sb.Append("<center style=\"width: 100 %; background: #f8f8f8\">");
sb.Append("<div class=\"email-container\" style=\"max-width: 500px; margin: 0 auto\">");
sb.Append("<table border = \"0\" bgcolor = \"#F8F8F8\" cellpadding = \"0\" cellspacing = \"0\" role = \"presentation\" style = \"max-width: 500px; width: 100%\"> ");
//ShowEasy Logo
sb.Append("<tr>");
sb.Append("<td style = \"padding-top: 40px;padding-right:0px;padding-bottom:30px;padding-left:60px; text-align: left\" class=\"sm-px\">");
sb.Append("<a href=\"https://www.showeasy.com/ \">");
sb.Append("<img src = \"https://d3kpqi6h465b7i.cloudfront.net/email/logo.png \" width = \"133\" height = \"18\" style = \"display: block\"/> ");
sb.Append("</a>");
sb.Append("</td>");
sb.Append("</tr>");
return sb.ToString();
}
public string MailButtom() {
StringBuilder sb = new StringBuilder();
//Email Buttom
//Text:If the button isn't working....
sb.Append("<tr>");
sb.Append("<td bgcolor = \"#FEFEFE\" width = \"340\" width = \"340px\" style = \"display: block;padding-top: 30px;padding-left: 30px;padding-right: 30px;color: #9c9c9c;text-align: center;\">");
sb.Append("<p style = \"font-weight: 400;font-size: 12px;line-height: 14px;letter-spacing: 0.02em;font-family: 'arial', 'sans-serif';margin: 0 0 0px;\" class=\"has-markdown\">");
sb.Append("如果按鈕無法點擊,你可以直接點擊以下的連結:");
sb.Append("</p>");
sb.Append("</td>");
sb.Append("</tr>");
//Link
sb.Append("<tr>");
sb.Append("<td align = \"center\" width = \"340\" bgcolor = \"#FEFEFE\" style = \"display: block;padding-bottom: 30px;padding-top: 0px;padding-left: 30px;padding-right: 30px;color: #9c9c9c;text-align: center;border-bottom-left-radius: 16px;border-bottom-right-radius: 16px;\">");
sb.Append("<a href = \"https://www.showeasy.com/aboutUs \" style = \"color: #7997ff;font-size: 12px;font-weight: 400;font-family: 'Arial', '微軟正黑體','Microsoft JhengHei', 'Helvetica Neue',Helvetica, Arial, sans-serif;padding: 0;margin: 0;text-align: center;padding-left: 0px;padding-right: 30px;padding-top: 4px;text-decoration: underline;\">");
sb.Append("<span align=\"center\" width=\"340\">https://www.showeasy.com/aboutUs</span>");
sb.Append("</a>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</td>");
sb.Append("</tr>");
return sb.ToString();
}
public string MailFooter() {
StringBuilder sb = new StringBuilder();
//Footer
//Text:Follow us
sb.Append("<tr>");
sb.Append("<td style=\"padding-top: 20px; padding-bottom: 20px\" class=\"sm-p\">");
sb.Append("<table align = \"left\" border = \"0\" cellpadding = \"0\" cellspacing = \"0\" role = \"presentation\" width = \"100%\">");
sb.Append("<tr>");
sb.Append("<td style=\"display: block; color: #232323; text-align: left\">");
sb.Append("<h1 style =\"text-align: center;font-family: 'Arial', 'sans-serif';font-weight: 700;font-size: 14px;line-height: 18px;color: #232323;margin: 0 0 0 0;\">");
sb.Append("追蹤我們");
sb.Append("</h1>");
sb.Append("</td>");
sb.Append("</tr>");
//FB、IG、Medium Icon
sb.Append("<tr>");
sb.Append("<td align=\"center\" style=\"padding-top: 10px\">");
sb.Append("<table>");
sb.Append("<tr align=\"center\">");
sb.Append("<td>");
sb.Append("<img style = \"display: block\" src = \"https://d3kpqi6h465b7i.cloudfront.net/email/icon-facebook.png \" width = \"30\" height = \"30\"/>");
sb.Append("</td>");
sb.Append("<td style=\"padding-left: 20px; padding-right: 20px\">");
sb.Append("<img style =\"display: block\" src = \"https://d3kpqi6h465b7i.cloudfront.net/email/icon-instagram.png \" width = \"30\" height = \"30\"/>");
sb.Append("</td>");
sb.Append("<td>");
sb.Append("<img style = \"display: block\" src = \"https://d3kpqi6h465b7i.cloudfront.net/email/icon-medium.png \" width = \"30\" height = \"30\"/>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</td>");
sb.Append("</tr>");
//Text:2022 Showeasy. All rights reserved.
sb.Append("<tr>");
sb.Append("<td style=\"padding-top: 30px\">");
sb.Append("<h1 align = \"center\" style =\"color: #bababa;font-size: 10px;font-weight: 400;font-family: 'Arial', 'sans-serif';padding: 0;margin: 0;line-height: 14px;\">");
sb.Append("© 2023 Showeasy. All rights reserved.");
sb.Append("</h1>");
sb.Append("</td>");
sb.Append("</tr>");
//Text:www.showeasy.com
sb.Append("<tr>");
sb.Append("<td>");
sb.Append("<h1 align = \"center\" style = \"font-weight: 400;color: #232323;line-height: 22px;font-size: 10px;font-weight: 400;font-family: 'Arial', 'sans-serif';padding: 0;margin: 0;\">");
sb.Append("www.showeasy.com");
sb.Append("</h1>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</td>");
sb.Append("</tr>");
sb.Append("</table>");
sb.Append("</div>");
sb.Append("</center>");
sb.Append("</body>");
sb.Append("</html>");
return sb.ToString();
}
}
}