wouterfennis / CodeRefactorFW

For ASP Assignment
0 stars 1 forks source link

HTML string verkleinen #13

Closed wouterfennis closed 8 years ago

wouterfennis commented 8 years ago

De volgende regel code in de MailService.java bevat een html opmaak

            msg.setContent("<html><head><style>body{width: 100%;height: auto;background-color: white;font-family: 'Arial';}.wrapper{width: 90%;min-width: 365px;margin: 10px auto;padding: 10px;background: #49c0f0; /* Old browsers */background: -moz-linear-gradient(top,  #49c0f0 0%, #2cafe3 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#49c0f0), color-stop(100%,#2cafe3)); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top,  #49c0f0 0%,#2cafe3 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top,  #49c0f0 0%,#2cafe3 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top,  #49c0f0 0%,#2cafe3 100%); /* IE10+ */background: linear-gradient(to bottom,  #49c0f0 0%,#2cafe3 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#49c0f0', endColorstr='#2cafe3',GradientType=0 ); /* IE6-9 */-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}.content{padding: 5px;background: rgb(249,252,247); /* Old browsers */background: -moz-linear-gradient(top,  rgba(249,252,247,1) 0%, rgba(245,249,240,1) 100%); /* FF3.6+ */background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(249,252,247,1)), color-stop(100%,rgba(245,249,240,1))); /* Chrome,Safari4+ */background: -webkit-linear-gradient(top,  rgba(249,252,247,1) 0%,rgba(245,249,240,1) 100%); /* Chrome10+,Safari5.1+ */background: -o-linear-gradient(top,  rgba(249,252,247,1) 0%,rgba(245,249,240,1) 100%); /* Opera 11.10+ */background: -ms-linear-gradient(top,  rgba(249,252,247,1) 0%,rgba(245,249,240,1) 100%); /* IE10+ */background: linear-gradient(to bottom,  rgba(249,252,247,1) 0%,rgba(245,249,240,1) 100%); /* W3C */filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f9fcf7', endColorstr='#f5f9f0',GradientType=0 ); /* IE6-9 */-webkit-border-radius: 5px;-moz-border-radius: 5px;border-radius: 5px;}.bold_text{font-weight: bold;}.custom_table{margin-left: 20px;padding: 2px;background-color: #079FD9;}.row {padding: 5px;background-color: #71D1F5;}.data {width: 150px;}</style></head><body><div class='wrapper'><div class='header'><h1>FamilyWeb</h1></div><div class='content'> " + message + "</div></body></html>","text/html" );

Dit zorgt nu voor een hele lange horizontale regel.

Misschien uit een file lezen? Anders een constante maar dan blijft hij wel lang

joeryhuiden commented 8 years ago

extracted naar verschillende methodes die de mail opmaken.