-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSentEvent.amp
More file actions
44 lines (36 loc) · 1.89 KB
/
SentEvent.amp
File metadata and controls
44 lines (36 loc) · 1.89 KB
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
34
35
36
37
38
39
40
41
42
43
44
%%[
/* Initialize the RetrieveRequest object to fetch SentEvent details */
SET @sentEventRequest = CreateObject("RetrieveRequest")
SetObjectProperty(@sentEventRequest, "ObjectType", "SentEvent")
AddObjectArrayItem(@sentEventRequest, "Properties", "BatchID")
AddObjectArrayItem(@sentEventRequest, "Properties", "TriggeredSendDefinitionObjectID")
AddObjectArrayItem(@sentEventRequest, "Properties", "EventDate")
AddObjectArrayItem(@sentEventRequest, "Properties", "SendID")
AddObjectArrayItem(@sentEventRequest, "Properties", "SubscriberKey")
/* Execute the RetrieveRequest to fetch SentEvent details */
SET @sentEventResult = InvokeRetrieve(@sentEventRequest, @retrieveStatus, @retrieveRequestID)
/* Output the retrieve status */
OutputLine(Concat("Retrieve Status: ", @retrieveStatus))
/* Check if any records were retrieved */
IF RowCount(@sentEventResult) > 0 THEN
/* Loop through the retrieved SentEvent records */
FOR @recordIndex = 1 TO RowCount(@sentEventResult) DO
SET @sentEventData = Row(@sentEventResult, @recordIndex)
SET @batchID = Field(@sentEventData, "BatchID")
SET @triggeredSendDefinitionID = Field(@sentEventData, "TriggeredSendDefinitionObjectID")
SET @eventDate = Field(@sentEventData, "EventDate")
SET @sendID = Field(@sentEventData, "SendID")
SET @subscriberKey = Field(@sentEventData, "SubscriberKey")
/* Output the SentEvent details */
OutputLine(Concat("Batch ID: ", @batchID))
OutputLine(Concat("Triggered Send Definition ID: ", @triggeredSendDefinitionID))
OutputLine(Concat("Event Date: ", @eventDate))
OutputLine(Concat("Send ID: ", @sendID))
OutputLine(Concat("Subscriber Key: ", @subscriberKey))
OutputLine("-------------")
NEXT @recordIndex
ELSE
/* Output message if no records are found */
OutputLine("No SentEvent records found.")
ENDIF
]%%