diff --git a/email.html b/email.html index 378ed34..152c65d 100644 --- a/email.html +++ b/email.html @@ -1,50 +1,41 @@ <!DOCTYPE html> <html> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> - <meta property="og:title" content="Bulk Emails"> - <title>Bulk Email Summary</title> - <style>a{color:rgb(63,138,191) !important;text-decoration:none;}</style> - </head> +<head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> + <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> + <meta property="og:title" content="Bulk Emails"> + <title>Bulk Email Summary</title> +</head> - <body style="width: 100%;margin: 0;padding: 0;-webkit-font-smoothing: antialiased;text-align:center;" align="center"> - <table border="0" cellspacing="0" cellpadding="0" style="max-width:500px;margin:auto;text-align:left"> - <tbody> - <tr> - <td><div style="height: 10px;"></div></td> - </tr> - <? for (var i = 0; i < data.length; i++) { ?> - - <tr> - <td style="background-color: #fff; border:1px solid #d5dce0;border-radius: 10px;box-shadow: 0 2px 4px rgba(0,0,0,0.18);" bgcolor="#fff"> - <div style="padding: 0 10px; margin: 0; display: block;"> - <h4 style="font-family: Georgia, Times, sans; font-weight: normal; color: #666; font-size: 13px; margin: 0; padding-top: 12px;"> - - <?= data[i].from ?> wrote: - - </h4> - </div> - - <p style="font-family: Georgia, Times, sans; color: #666; padding: 5px 10px 0;margin: 0; font-size: 14px;"> - <strong><?= data[i].subject ?></strong> - </p> - <p style="font-family: Georgia, Times, sans; color: #999; padding: 0 10px 10px; margin: 0; font-size: 10px;"> - at <?= Utilities.formatDate(data[i].date, Session.getScriptTimeZone(), "HH:mm 'on' MMM d") ?> - from <?= data[i].email ?> - <? if(data[i].uns) { ?> - | <a style="background-color: #eee; border: 1px solid #ccc; border-radius: 2px; padding:0 2px" bgcolor="#eee" - href="<?= data[i].uns ?>">unsubscribe</a> - </p> - <? } ?> - </td> - </tr> +<body> + <table border="0" cellspacing="1em" cellpadding="1em"> + <tbody> + <? for (var i = 0; i < data.length; i++) { ?> <tr> - <td><div style="height: 15px;"></div></td> - </tr> - <? } ?> - - </tbody> - </table> - </body> + <td style='margin: 0 1em 0 0;'> + <h4 style="margin: 0; padding-top: 12px;font-weight:normal"> + <a style="color:rgb(63,138,191) !important;text-decoration:none;" + href="mailto:<?= data[i].email ?>"><?= data[i].from ?></a> + </h4> + <p style="margin: 0;"> + at <?= Utilities.formatDate(data[i].date, Session.getScriptTimeZone(), "HH:mm 'on' MMM d") ?> + </p> + <p style="margin: 0;"> + <? if(data[i].uns) { ?> + <a style="display:inline-block;color:rgb(255,255,255); padding:0.25em; background:rgb(63,138,191); border-radius: 5px !important;text-decoration:none;" + href="<?= data[i].uns ?>">unsubscribe</a> + <? } ?> + </p> + </td> + <td> + <p style="margin: 0; padding: 0;"> + <a style='font-size:1.5em !important; color:rgb(22,22,22) !important; text-decoration:none;' href="<?= data[i].permalink?>"><?= data[i].subject ?></a> + </p> + </td> + </tr> + <? } ?> + + </tbody> + </table> +</body> </html> diff --git a/noneroll.gs b/noneroll.gs index 2140ff7..1713d70 100644 --- a/noneroll.gs +++ b/noneroll.gs @@ -47,6 +47,7 @@ function getEmails() { for (var i = 0; i < threads.length; i++) { if (threads[i].getLastMessageDate()>maxDate){ var d = {} + d.permalink = threads[i].getPermalink() d.subject = threads[i].getFirstMessageSubject() var from = threads[i].getMessages()[0].getFrom() d.from = from.replace(/\"|<.*>/g,'')