-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathLogService.cls
33 lines (24 loc) · 906 Bytes
/
LogService.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
public class LogService implements Callable {
public class Definition {
String Tag = 'Examples';
String Label = 'Log Service';
String Description = 'Sends an email containing the event parameters.';
String Icon = 'lightning';
Integer Chunks = 5;
Map<String, String> StepConfig = new Map<String, String>{
'address' => 'String'
};
}
// execute
public Object call(String m, Map<String, Object> event) {
Messaging.SingleEmailMessage message = new Messaging.SingleEmailMessage();
message.setSubject('[Log] ' + UserInfo.getOrganizationName());
message.setPlainTextBody(Json.serializePretty(event));
message.setToAddresses(new List<String>{
(String)event.get('address')
});
return new List<Object>{
event, message
};
}
}