-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTriggeredSendSummary.amp
More file actions
54 lines (46 loc) · 2.53 KB
/
TriggeredSendSummary.amp
File metadata and controls
54 lines (46 loc) · 2.53 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
45
46
47
48
49
50
51
52
53
54
%%[
/* Initialize the RetrieveRequest object to fetch SendSummary details */
SET @sendSummaryRequest = CreateObject("RetrieveRequest")
SetObjectProperty(@sendSummaryRequest, "ObjectType", "TriggeredSendSummary")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "Bounces")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "Clicks")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "NotSentDueToError")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "NotSentDueToOptOut")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "Opens")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "OptOuts")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "Sent")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "UniqueClicks")
AddObjectArrayItem(@sendSummaryRequest, "Properties", "UniqueOpens")
/* Execute the RetrieveRequest to fetch SendSummary details */
SET @sendSummaryResult = InvokeRetrieve(@sendSummaryRequest, @retrieveStatus, @retrieveRequestID)
/* Output the retrieve status */
OutputLine(Concat("Retrieve Status: ", @retrieveStatus))
/* Check if any records were retrieved */
IF RowCount(@sendSummaryResult) > 0 THEN
/* Loop through the retrieved SendSummary records */
FOR @recordIndex = 1 TO RowCount(@sendSummaryResult) DO
SET @sendSummaryData = Row(@sendSummaryResult, @recordIndex)
SET @accountID = Field(@sendSummaryData, "AccountID")
SET @accountName = Field(@sendSummaryData, "AccountName")
SET @createdDate = Field(@sendSummaryData, "CreatedDate")
SET @sendID = Field(@sendSummaryData, "SendID")
SET @totalSent = Field(@sendSummaryData, "TotalSent")
SET @transactional = Field(@sendSummaryData, "Transactional")
SET @nonTransactional = Field(@sendSummaryData, "NonTransactional")
SET @deliveredTime = Field(@sendSummaryData, "DeliveredTime")
/* Output the SendSummary details */
OutputLine(Concat("Account ID: ", @accountID))
OutputLine(Concat("Account Name: ", @accountName))
OutputLine(Concat("Created Date: ", @createdDate))
OutputLine(Concat("Send ID: ", @sendID))
OutputLine(Concat("Total Sent: ", @totalSent))
OutputLine(Concat("Transactional: ", @transactional))
OutputLine(Concat("Non-Transactional: ", @nonTransactional))
OutputLine(Concat("Delivered Time: ", @deliveredTime))
OutputLine("-------------")
NEXT @recordIndex
ELSE
/* Output message if no records are found */
OutputLine("No SendSummary records found.")
ENDIF
]%%