Created
January 30, 2018 15:13
-
-
Save Mando75/5d1bfc8d0cc87085967c8b303796600a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendAlert(employee, date, vLog) { | |
var message = ("<head><style>" | |
+" @import url('https://fonts.googleapis.com/css?family=Work+Sans');" | |
+" #main {" | |
+" font-family: 'Work Sans', sans-serif;" | |
+" font-size: 14pt;" | |
+" padding: 1em; " | |
+" max-width: 600px" | |
+" }" | |
+" div#header {" | |
+" background-color: #333;" | |
+" padding: 0.8em;" | |
+" }" | |
+" " | |
+" div#header img {" | |
+" width: 50%;" | |
+" }" | |
+" #encouragement {" | |
+" width: 50%;" | |
+" height: 50%" | |
+" }" | |
+" #article {" | |
+" padding: 1em;" | |
+" background-color: #e8e8e8;" | |
+" }" | |
+" #btn {" | |
+" background-color:#44C667;" | |
+" width:80px;" | |
+" padding: 2%;" | |
+" color:#fff;" | |
+" border: 1px solid #21AA2A;" | |
+" border-radius: 50px;" | |
+" }" | |
+" a {" | |
+" text-decoration: none;" | |
+" }" | |
+" </style></head>" | |
+" <body>" | |
+" <div id='main'>" | |
+" <div id='header'>" | |
+" <img src='https://ftcemployees.github.io/assets/FTC-Logo.png'>" | |
+" </div>" | |
+" <div id='article'>" | |
+" Hi " + employee.firstName + ",<br><br>" | |
+" My digital bloodhounds have detected a change to an event on your work schedule on " | |
+ date | |
+", which falls within the next 48 hours. If you haven't already, please notify Bro." | |
+" Wilcock of the change." | |
//+" <img src='https://drive.google.com/open?export=view&id=1q4a78_-9mIFAGAjzt-zpbPLapgan9FQ8' /> | |
+" <br><br>Warmest regards,<br><br>" | |
+" Connor</div>" | |
+" </div>" | |
+" </body>"); | |
// Send email to violator | |
MailApp.sendEmail(['connor.a.spurling@gmail.com',employee.email], 'Work Schedule Change', 'body', {htmlBody:message}); | |
// Mark off on the violation log that the person has been notified | |
var data = vLog.getDataRange().getDisplayValues(); | |
vLog.getRange(data.length,7).setValue(true); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment