Skip to content

Commit b497f27

Browse files
committed
include link to online newsletter
1 parent 22fbce6 commit b497f27

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ These steps will demonstrate the basic functionality of the programme using the
5656

5757
## Special Instructions ##
5858

59-
`java -cp ".:../lib/javax.mail.jar" CCmailer ../../privateinfo.txt ../sample/ ../../../Websites/newsletters.nuscomputing.com/2016/09/12/ index.html acadAdvisory`
59+
`java -cp ".:../lib/javax.mail.jar" CCmailer ../../privateinfo.txt ../sample/ ../../../Websites/newsletters.nuscomputing.com/2016/September/12/ index.html acadAdvisory`

src/HtmlConstants.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ public final class HtmlConstants {
1414
+ " <table style=\"border:none;width:600px;color:"
1515
+ "rgb(85,85,85);font-family:Optima,\'Trebuchet MS\',sans-serif\" "
1616
+ "border=\"0\" width=\"600\">\n"
17-
+ " <tbody>\n <tr>\n"
17+
+ " <tbody>\n"
18+
+ " <tr>\n"
19+
+ " <td style=\"padding:10px 20px;vertical-align:"
20+
+ "middle;width:auto;text-align:center;font-size:10pt;margin:0px\""
21+
+ ">Having trouble reading this? View it in your browser at "
22+
+ "<a href=\"%s\">%s</a></td>\n"
23+
+ " </tr>\n"
24+
+ " <tr>\n"
1825
+ " <td style=\"padding:10px 20px;vertical-align:"
1926
+ "top;width:auto;text-align:justify;font-size:10pt\">";
2027
public static final String AFTER_DATE =

src/HtmlGenerator.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,10 @@ public String generateHtml(String folderPath, String outputPath,
192192
files.mkdirs();
193193
files = new File(outputPath + "contents/");
194194
files.mkdirs();
195-
html += HtmlConstants.OPENING;
195+
int urlStart = outputPath.indexOf("newsletters.nuscomputing.com");
196+
String indexUrl = "http://" + outputPath.substring(urlStart,
197+
outputPath.length()) + outputName;
198+
html += String.format(HtmlConstants.OPENING, indexUrl, indexUrl);
196199
html += getDate();
197200
if (emailType.equals(FLAG_EMAIL_BLAST)) {
198201
html += String.format(HtmlConstants.AFTER_DATE, CC_NEWSLETTER);

0 commit comments

Comments
 (0)