Created
May 20, 2014 16:43
-
-
Save mtetlow/ca2df4d4f9dc5184c1f0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
trigger taskAfterUpdateAndInsert on TASKRAY__Project_Task__c (after insert, after update) { | |
for(TASKRAY__Project_Task__c task: Trigger.new){ | |
if((task.TASKRAY__List__c == 'Finished') && (Trigger.IsInsert || (Trigger.Isupdate && (Trigger.OLdmap.get(task.id).TASKRAY__List__c <> 'Finished'))) ){ | |
Datetime dt = Datetime.now(); | |
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | |
String[] toAddresses = new String[] {'[email protected]'}; | |
mail.setToAddresses(toAddresses); | |
mail.setReplyTo('[email protected]'); | |
mail.setSenderDisplayName('basati test'); | |
mail.setSubject('basati test'); | |
mail.setCharset('UTF-8'); | |
mail.setHtmlBody('test at '+String.valueOf(dt.getTime())); | |
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail }); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment