-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.xaml
500 lines (500 loc) · 39 KB
/
Main.xaml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
<Activity mc:Ignorable="sap sap2010" x:Class="Main" VisualBasic.Settings="{x:Null}" sap:VirtualizedContainerService.HintSize="994,3348" sap2010:WorkflowViewState.IdRef="ActivityBuilder_1" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:s="clr-namespace:System;assembly=System.Private.CoreLib" xmlns:sap="http://schemas.microsoft.com/netfx/2009/xaml/activities/presentation" xmlns:sap2010="http://schemas.microsoft.com/netfx/2010/xaml/activities/presentation" xmlns:scg="clr-namespace:System.Collections.Generic;assembly=System.Private.CoreLib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=System.Private.CoreLib" xmlns:snm="clr-namespace:System.Net.Mail;assembly=System.Net.Mail" xmlns:ui="http://schemas.uipath.com/workflow/activities" xmlns:um="clr-namespace:UiPath.Mail;assembly=UiPath.Mail.Activities" xmlns:umab="clr-namespace:UiPath.Mail.Activities.Business;assembly=UiPath.Mail.Activities" xmlns:umabh="clr-namespace:UiPath.Mail.Activities.Business.HtmlEditor;assembly=UiPath.Mail.Activities" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<TextExpression.NamespacesForImplementation>
<sco:Collection x:TypeArguments="x:String">
<x:String>System.Activities</x:String>
<x:String>System.Activities.Statements</x:String>
<x:String>System.Activities.Expressions</x:String>
<x:String>System.Activities.Validation</x:String>
<x:String>System.Activities.XamlIntegration</x:String>
<x:String>Microsoft.VisualBasic</x:String>
<x:String>Microsoft.VisualBasic.Activities</x:String>
<x:String>System</x:String>
<x:String>System.Collections</x:String>
<x:String>System.Collections.Generic</x:String>
<x:String>System.Collections.ObjectModel</x:String>
<x:String>System.Data</x:String>
<x:String>System.Diagnostics</x:String>
<x:String>System.Drawing</x:String>
<x:String>System.IO</x:String>
<x:String>System.Linq</x:String>
<x:String>System.Net.Mail</x:String>
<x:String>System.Xml</x:String>
<x:String>System.Xml.Linq</x:String>
<x:String>UiPath.Core</x:String>
<x:String>UiPath.Core.Activities</x:String>
<x:String>System.Windows.Markup</x:String>
<x:String>GlobalVariablesNamespace</x:String>
<x:String>GlobalConstantsNamespace</x:String>
<x:String>System.Runtime.Serialization</x:String>
<x:String>System.Activities.Runtime.Collections</x:String>
<x:String>System.Reflection</x:String>
<x:String>UiPath.Activities.Contracts</x:String>
<x:String>System.Security</x:String>
<x:String>UiPath.Mail</x:String>
<x:String>UiPath.Mail.IMAP.Activities</x:String>
<x:String>UiPath.Mail.Activities</x:String>
<x:String>UiPath.Shared.Activities</x:String>
<x:String>UiPath.Mail.Activities.Business.ForEachMail</x:String>
<x:String>UiPath.Mail.Activities.Business</x:String>
<x:String>UiPath.Shared.Activities.Business</x:String>
<x:String>UiPath.Platform.ResourceHandling</x:String>
<x:String>System.Collections.Specialized</x:String>
<x:String>UiPath.UIAutomationCore.Contracts</x:String>
<x:String>UiPath.Mail.SMTP.Activities</x:String>
<x:String>UiPath.Mail.Outlook.Activities</x:String>
<x:String>UiPath.Shared.Activities.ConnectionService.Contracts</x:String>
<x:String>UiPath.Mail.Activities.Utils</x:String>
<x:String>UiPath.Mail.Activities.Business.HtmlEditor</x:String>
</sco:Collection>
</TextExpression.NamespacesForImplementation>
<TextExpression.ReferencesForImplementation>
<sco:Collection x:TypeArguments="AssemblyReference">
<AssemblyReference>Microsoft.VisualBasic</AssemblyReference>
<AssemblyReference>mscorlib</AssemblyReference>
<AssemblyReference>PresentationCore</AssemblyReference>
<AssemblyReference>PresentationFramework</AssemblyReference>
<AssemblyReference>System</AssemblyReference>
<AssemblyReference>System.Activities</AssemblyReference>
<AssemblyReference>System.ComponentModel.TypeConverter</AssemblyReference>
<AssemblyReference>System.Core</AssemblyReference>
<AssemblyReference>System.Data</AssemblyReference>
<AssemblyReference>System.Data.Common</AssemblyReference>
<AssemblyReference>System.Data.DataSetExtensions</AssemblyReference>
<AssemblyReference>System.Drawing</AssemblyReference>
<AssemblyReference>System.Drawing.Common</AssemblyReference>
<AssemblyReference>System.Drawing.Primitives</AssemblyReference>
<AssemblyReference>System.Linq</AssemblyReference>
<AssemblyReference>System.ObjectModel</AssemblyReference>
<AssemblyReference>System.Private.CoreLib</AssemblyReference>
<AssemblyReference>System.Xaml</AssemblyReference>
<AssemblyReference>System.Xml</AssemblyReference>
<AssemblyReference>System.Xml.Linq</AssemblyReference>
<AssemblyReference>UiPath.System.Activities</AssemblyReference>
<AssemblyReference>UiPath.UiAutomation.Activities</AssemblyReference>
<AssemblyReference>WindowsBase</AssemblyReference>
<AssemblyReference>UiPath.Studio.Constants</AssemblyReference>
<AssemblyReference>System.Private.ServiceModel</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Formatters</AssemblyReference>
<AssemblyReference>System.Private.DataContractSerialization</AssemblyReference>
<AssemblyReference>System.Runtime.Serialization.Primitives</AssemblyReference>
<AssemblyReference>System.Reflection.DispatchProxy</AssemblyReference>
<AssemblyReference>System.Reflection.TypeExtensions</AssemblyReference>
<AssemblyReference>System.Reflection.Metadata</AssemblyReference>
<AssemblyReference>UiPath.Activities.Contracts</AssemblyReference>
<AssemblyReference>UiPath.Workflow</AssemblyReference>
<AssemblyReference>System.Security.Permissions</AssemblyReference>
<AssemblyReference>System.Runtime.InteropServices</AssemblyReference>
<AssemblyReference>UiPath.Mail.Activities</AssemblyReference>
<AssemblyReference>UiPath.Mail</AssemblyReference>
<AssemblyReference>UiPath.Mail.Activities.Design</AssemblyReference>
<AssemblyReference>UiPath.Excel.Activities</AssemblyReference>
<AssemblyReference>UiPath.Testing.Activities</AssemblyReference>
<AssemblyReference>UiPath.OCR.Activities</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationCore</AssemblyReference>
<AssemblyReference>System.Net.Mail</AssemblyReference>
<AssemblyReference>UiPath.UIAutomationNext.Activities</AssemblyReference>
<AssemblyReference>System.Collections.NonGeneric</AssemblyReference>
<AssemblyReference>System.Collections</AssemblyReference>
<AssemblyReference>UiPath.Platform</AssemblyReference>
<AssemblyReference>NPOI</AssemblyReference>
<AssemblyReference>System.Memory.Data</AssemblyReference>
<AssemblyReference>System.Console</AssemblyReference>
<AssemblyReference>System.Configuration.ConfigurationManager</AssemblyReference>
<AssemblyReference>System.ComponentModel</AssemblyReference>
<AssemblyReference>System.Memory</AssemblyReference>
<AssemblyReference>System.Private.Uri</AssemblyReference>
<AssemblyReference>System.Collections.Specialized</AssemblyReference>
<AssemblyReference>UiPath.System.Activities.Design</AssemblyReference>
<AssemblyReference>UiPath.System.Activities.ViewModels</AssemblyReference>
<AssemblyReference>System.CodeDom</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic.Forms</AssemblyReference>
<AssemblyReference>Microsoft.VisualBasic.Core</AssemblyReference>
<AssemblyReference>System.IO.FileSystem.Watcher</AssemblyReference>
<AssemblyReference>System.IO.Packaging</AssemblyReference>
<AssemblyReference>System.IO.FileSystem.AccessControl</AssemblyReference>
<AssemblyReference>System.IO.FileSystem.DriveInfo</AssemblyReference>
</sco:Collection>
</TextExpression.ReferencesForImplementation>
<Sequence DisplayName="Main Sequence" sap:VirtualizedContainerService.HintSize="846,3283" sap2010:WorkflowViewState.IdRef="Sequence_1">
<Sequence.Variables>
<Variable x:TypeArguments="x:Int32" Name="counter">
<Variable.Default>
<Literal x:TypeArguments="x:Int32" Value="1" />
</Variable.Default>
</Variable>
<Variable x:TypeArguments="x:String" Name="varMailSender" />
<Variable x:TypeArguments="x:String" Name="varMailSubject" />
<Variable x:TypeArguments="scg:ICollection(x:String)" Name="varListOfEmailAttrs">
<Variable.Default>
<VisualBasicValue x:TypeArguments="scg:ICollection(x:String)" ExpressionText="New List(Of String)" />
</Variable.Default>
</Variable>
<Variable x:TypeArguments="x:String" Name="varEmailErrorTemplate" />
<Variable x:TypeArguments="ui:Image" Name="varErrorScreen" />
<Variable x:TypeArguments="x:String" Name="varHasAttachments" />
<Variable x:TypeArguments="x:String" Name="varEmailReport" />
<Variable x:TypeArguments="x:String" Name="varEmailSuccessTemplate" />
</Sequence.Variables>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<TryCatch DisplayName="Try Catch" sap:VirtualizedContainerService.HintSize="804,3195" sap2010:WorkflowViewState.IdRef="TryCatch_1">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<TryCatch.Try>
<Sequence sap:VirtualizedContainerService.HintSize="766,2967" sap2010:WorkflowViewState.IdRef="Sequence_2">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:WriteTextFile File="{x:Null}" DisplayName="Clear all the content within "EmailReport.txt"" FileName="EmailReport.txt" sap:VirtualizedContainerService.HintSize="724,133" sap2010:WorkflowViewState.IdRef="WriteTextFile_3">
<ui:WriteTextFile.Text>
<InArgument x:TypeArguments="x:String">
<Literal x:TypeArguments="x:String" Value="" />
</InArgument>
</ui:WriteTextFile.Text>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
</ui:WriteTextFile>
<Sequence DisplayName="Save the 10 most recent unread email messages to local folders" sap:VirtualizedContainerService.HintSize="724,2706" sap2010:WorkflowViewState.IdRef="Sequence_5">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<umab:OutlookApplicationCard Account="Meeno2b@outlook.com" AccountMismatchBehavior="UseDefaultEmailAccount" DisplayName="Save the 10 most recent unread Outlook emails" sap:VirtualizedContainerService.HintSize="662,2595" sap2010:WorkflowViewState.IdRef="OutlookApplicationCard_1">
<umab:OutlookApplicationCard.Body>
<ActivityAction x:TypeArguments="um:IMailQuickHandle">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="um:IMailQuickHandle" Name="Outlook" />
</ActivityAction.Argument>
<Sequence DisplayName="Do" sap:VirtualizedContainerService.HintSize="628,2415" sap2010:WorkflowViewState.IdRef="Sequence_14">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<umab:ForEachEmailX MailFilter="{x:Null}" DisplayName="Iterate through each unread email" sap:VirtualizedContainerService.HintSize="586,2327" sap2010:WorkflowViewState.IdRef="ForEachEmailX_1" IncludeSubfolders="False" Mails="[Outlook.Folder("UiPath Test")]" NumberOfEmailsLimit="10" UnreadOnly="True" WithAttachmentsOnly="False">
<umab:ForEachEmailX.Body>
<ActivityAction x:TypeArguments="snm:MailMessage, x:Int32">
<ActivityAction.Argument1>
<DelegateInArgument x:TypeArguments="snm:MailMessage" Name="CurrentMail" />
</ActivityAction.Argument1>
<ActivityAction.Argument2>
<DelegateInArgument x:TypeArguments="x:Int32" Name="CurrentIndex" />
</ActivityAction.Argument2>
<Sequence DisplayName="Do" sap:VirtualizedContainerService.HintSize="552,2076" sap2010:WorkflowViewState.IdRef="Sequence_15">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign DisplayName="Get current email's subject" sap:VirtualizedContainerService.HintSize="510,82" sap2010:WorkflowViewState.IdRef="Assign_1">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSubject]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">[CurrentMail.Subject.Replace("'", " ").Replace(":", " ").Replace(".", " ").Replace("【", " ").Replace("】", " ").Replace("+", " ").Replace("?", " ").Replace("!", " ")]</InArgument>
</Assign.Value>
</Assign>
<Switch x:TypeArguments="x:String" DisplayName="Categorise email senders" Expression="[CurrentMail.From.Address]" sap:VirtualizedContainerService.HintSize="510,442" sap2010:WorkflowViewState.IdRef="Switch`1_2">
<Switch.Default>
<Assign DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_23">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">Unkown</InArgument>
</Assign.Value>
</Assign>
</Switch.Default>
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign x:Key="no-reply@m.mail.coursera.org" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_13">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">Coursera</InArgument>
</Assign.Value>
</Assign>
<Assign x:Key="Coursera@email.coursera.org" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_14">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">Coursera</InArgument>
</Assign.Value>
</Assign>
<Assign x:Key="online@e.bigw.com.au" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_15">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">BIG W</InArgument>
</Assign.Value>
</Assign>
<Assign x:Key="mail@bigw.com.au" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_16">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">BIG W</InArgument>
</Assign.Value>
</Assign>
<Assign x:Key="ubereats@uber.com" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_17">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">Uber</InArgument>
</Assign.Value>
</Assign>
<Assign x:Key="uberone@uber.com" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_18">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">Uber</InArgument>
</Assign.Value>
</Assign>
<Assign x:Key="noreplytickets@taronga.org.au" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_19">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">Taronga Zoo</InArgument>
</Assign.Value>
</Assign>
<Assign x:Key="ebills@winconnect.com.au" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_20">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">WinConnect Electricity</InArgument>
</Assign.Value>
</Assign>
<Assign x:Key="meenoxiong@gmail.com" DisplayName="Define email sender" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_24">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varMailSender]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">Me</InArgument>
</Assign.Value>
</Assign>
</Switch>
<umab:SaveMailX DisplayName="Save the current email" FileName="[varMailSubject]" FolderPath="["EmailsSaved\" + varMailSender + "\" + 
CDate(CurrentMail.Headers("Date")).ToString("yyyy-MM-dd hh-mm-ss") + "\"]" sap:VirtualizedContainerService.HintSize="510,186" sap2010:WorkflowViewState.IdRef="SaveMailX_1" MailMessage="[CurrentMail]" />
<umab:SaveMailAttachmentsX Attachments="{x:Null}" DisplayName="Save Email Attachments" ExcludeInlineAttachments="True" FolderPath="["EmailsSaved\" + varMailSender + "\" + 
CDate(CurrentMail.Headers("Date")).ToString("yyyy-MM-dd hh-mm-ss") + 
"\Attachments\"]" sap:VirtualizedContainerService.HintSize="510,228" sap2010:WorkflowViewState.IdRef="SaveMailAttachmentsX_1" Message="[CurrentMail]" OverwriteExisting="True" />
<ui:LogMessage DisplayName="Log progress message" sap:VirtualizedContainerService.HintSize="510,141" sap2010:WorkflowViewState.IdRef="LogMessage_1" Level="[UiPath.Core.Activities.LogLevel.Info]" Message="["Successfully Saved: " + varMailSubject]" />
<If Condition="[Directory.GetFiles("EmailsSaved\" + varMailSender + "\" + 
							CDate(CurrentMail.Headers("Date")).ToString("yyyy-MM-dd hh-mm-ss") + 
							"\Attachments\").Length > 0]" DisplayName="Check if any attachment exist in the current email" sap:VirtualizedContainerService.HintSize="510,522" sap2010:WorkflowViewState.IdRef="If_2">
<If.Then>
<Sequence sap:VirtualizedContainerService.HintSize="476,170" sap2010:WorkflowViewState.IdRef="Sequence_18">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign DisplayName="Assign" sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_26">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varHasAttachments]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">Yes</InArgument>
</Assign.Value>
</Assign>
</Sequence>
</If.Then>
<If.Else>
<Sequence sap:VirtualizedContainerService.HintSize="476,170" sap2010:WorkflowViewState.IdRef="Sequence_19">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<Assign sap:VirtualizedContainerService.HintSize="434,82" sap2010:WorkflowViewState.IdRef="Assign_27">
<Assign.To>
<OutArgument x:TypeArguments="x:String">[varHasAttachments]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:String">No</InArgument>
</Assign.Value>
</Assign>
</Sequence>
</If.Else>
</If>
<AddToCollection x:TypeArguments="x:String" Collection="[varListOfEmailAttrs]" DisplayName="Add the attributes of current email to a list" sap:VirtualizedContainerService.HintSize="510,25" sap2010:WorkflowViewState.IdRef="AddToCollection`1_1" Item="["Email " + counter.ToString + " sent on " + 
CDate(CurrentMail.Headers("Date")).ToString("dd/MM/yyyy hh:mm:ss") +Environment.NewLine +
"Subject: " + varMailSubject + Environment.NewLine + 
"From: " + varMailSender + Environment.NewLine +
"Has Attachments: " + varHasAttachments + Environment.NewLine +
"----------------------------------------------------------------------------------"]" />
<Assign DisplayName="Increment Email Counter" sap:VirtualizedContainerService.HintSize="510,82" sap2010:WorkflowViewState.IdRef="Assign_25">
<Assign.To>
<OutArgument x:TypeArguments="x:Int32">[counter]</OutArgument>
</Assign.To>
<Assign.Value>
<InArgument x:TypeArguments="x:Int32">[counter + 1]</InArgument>
</Assign.Value>
</Assign>
</Sequence>
</ActivityAction>
</umab:ForEachEmailX.Body>
</umab:ForEachEmailX>
</Sequence>
</ActivityAction>
</umab:OutlookApplicationCard.Body>
</umab:OutlookApplicationCard>
</Sequence>
</Sequence>
</TryCatch.Try>
<TryCatch.Catches>
<Catch x:TypeArguments="s:Exception" sap:VirtualizedContainerService.HintSize="770,21" sap2010:WorkflowViewState.IdRef="Catch`1_1">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">False</x:Boolean>
<x:Boolean x:Key="IsPinned">False</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ActivityAction x:TypeArguments="s:Exception">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="s:Exception" Name="exception" />
</ActivityAction.Argument>
<Sequence sap:VirtualizedContainerService.HintSize="552,1603" sap2010:WorkflowViewState.IdRef="Sequence_9">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:MessageBox Caption="{x:Null}" ChosenButton="{x:Null}" AutoCloseAfter="00:00:00" DisplayName="Display error message" sap:VirtualizedContainerService.HintSize="510,85" sap2010:WorkflowViewState.IdRef="MessageBox_1" Text="[exception.Message]" />
<ui:LogMessage DisplayName="Log error message" sap:VirtualizedContainerService.HintSize="510,141" sap2010:WorkflowViewState.IdRef="LogMessage_2" Level="[UiPath.Core.Activities.LogLevel.Error]" Message="[exception.Message]" />
<Sequence DisplayName="Take and save screenshot" sap:VirtualizedContainerService.HintSize="510,371" sap2010:WorkflowViewState.IdRef="Sequence_10">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:TakeScreenshot WaitBefore="{x:Null}" DisplayName="Take Screenshot" sap:VirtualizedContainerService.HintSize="388,87" sap2010:WorkflowViewState.IdRef="TakeScreenshot_1" Screenshot="[varErrorScreen]">
<ui:TakeScreenshot.Target>
<ui:Target ClippingRegion="{x:Null}" Element="{x:Null}" Selector="{x:Null}" Id="9b6e91be-eeb0-4005-8870-9c21a4b52cd6">
<ui:Target.TimeoutMS>
<InArgument x:TypeArguments="x:Int32" />
</ui:Target.TimeoutMS>
<ui:Target.WaitForReady>
<InArgument x:TypeArguments="ui:WaitForReady" />
</ui:Target.WaitForReady>
</ui:Target>
</ui:TakeScreenshot.Target>
</ui:TakeScreenshot>
<ui:SaveImage DisplayName="Save Image" FileName="ErrorScreenshot.png" sap:VirtualizedContainerService.HintSize="388,133" sap2010:WorkflowViewState.IdRef="SaveImage_1" Image="[varErrorScreen]" />
</Sequence>
<ui:ReadTextFile File="{x:Null}" Content="[varEmailErrorTemplate]" DisplayName="Read EmailErrorTemplate.txt" FileName="EmailTemplates\EmailErrorTemplate.txt" sap:VirtualizedContainerService.HintSize="510,80" sap2010:WorkflowViewState.IdRef="ReadTextFile_2" />
<umab:OutlookApplicationCard Account="Meeno2b@outlook.com" AccountMismatchBehavior="UseDefaultEmailAccount" DisplayName="Use Desktop Outlook App" sap:VirtualizedContainerService.HintSize="510,678" sap2010:WorkflowViewState.IdRef="OutlookApplicationCard_2">
<umab:OutlookApplicationCard.Body>
<ActivityAction x:TypeArguments="um:IMailQuickHandle">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="um:IMailQuickHandle" Name="Outlook" />
</ActivityAction.Argument>
<Sequence DisplayName="Do" sap:VirtualizedContainerService.HintSize="476,498" sap2010:WorkflowViewState.IdRef="Sequence_16">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<umab:SendMailX Bcc="{x:Null}" HtmlBodyFromText="{x:Null}" ReplyTo="{x:Null}" Account="[Outlook]" Body="[string.Format(varEmailErrorTemplate, Now, exception.Message)]" BodyType="Text" Cc="maxinexiong2@gmail.com" DisplayName="Private: Email error report to recipient" sap:VirtualizedContainerService.HintSize="434,410" sap2010:WorkflowViewState.IdRef="SendMailX_1" Importance="Normal" IsDraft="False" MaxBodyDocumentSizeMB="2" Sensitivity="Normal" Subject="Automation: Error" To="meenoxiong@gmail.com" UseDocumentAsBody="False">
<umab:SendMailX.Files>
<scg:List x:TypeArguments="InArgument(x:String)" Capacity="1">
<InArgument x:TypeArguments="x:String">ErrorScreenshot.png</InArgument>
</scg:List>
</umab:SendMailX.Files>
<umab:SendMailX.HtmlBodyFromFile>
<umabh:HtmlContentArgument FilePath=".data/HtmlContent0.html">
<umabh:HtmlContentArgument.RuntimeImages>
<scg:Dictionary x:TypeArguments="x:String, InArgument(x:String)" />
</umabh:HtmlContentArgument.RuntimeImages>
<umabh:HtmlContentArgument.ValueMappings>
<scg:List x:TypeArguments="umabh:HtmlValueMappingBase" Capacity="0" />
</umabh:HtmlContentArgument.ValueMappings>
</umabh:HtmlContentArgument>
</umab:SendMailX.HtmlBodyFromFile>
</umab:SendMailX>
</Sequence>
</ActivityAction>
</umab:OutlookApplicationCard.Body>
</umab:OutlookApplicationCard>
</Sequence>
</ActivityAction>
</Catch>
</TryCatch.Catches>
<TryCatch.Finally>
<Sequence DisplayName="Document the details of the current email in a list" sap:VirtualizedContainerService.HintSize="552,1423" sap2010:WorkflowViewState.IdRef="Sequence_7">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:ForEach x:TypeArguments="x:String" CurrentIndex="{x:Null}" DisplayName="Iterate through the attributes of each mail message" sap:VirtualizedContainerService.HintSize="510,407" sap2010:WorkflowViewState.IdRef="ForEach`1_2" Values="[varListOfEmailAttrs]">
<ui:ForEach.Body>
<ActivityAction x:TypeArguments="x:String">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="x:String" Name="currentEmailAttrs" />
</ActivityAction.Argument>
<Sequence DisplayName="Body" sap:VirtualizedContainerService.HintSize="376,221" sap2010:WorkflowViewState.IdRef="Sequence_11">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<ui:AppendLine File="{x:Null}" DisplayName="Append the attributes of current email to EmailReport.txt" FileName="EmailReport.txt" sap:VirtualizedContainerService.HintSize="334,133" sap2010:WorkflowViewState.IdRef="AppendLine_3" Text="[currentEmailAttrs]" UseDefaultEncoding="False" />
</Sequence>
</ActivityAction>
</ui:ForEach.Body>
</ui:ForEach>
<ui:ReadTextFile File="{x:Null}" Content="[varEmailReport]" DisplayName="Read the complete EmailReport.txt" FileName="EmailReport.txt" sap:VirtualizedContainerService.HintSize="510,80" sap2010:WorkflowViewState.IdRef="ReadTextFile_3" />
<ui:ReadTextFile File="{x:Null}" Content="[varEmailSuccessTemplate]" DisplayName="Read EmailSuccessTemplate.txt" FileName="EmailTemplates\EmailSuccessTemplate.txt" sap:VirtualizedContainerService.HintSize="510,80" sap2010:WorkflowViewState.IdRef="ReadTextFile_4" />
<umab:OutlookApplicationCard Account="Meeno2b@outlook.com" AccountMismatchBehavior="UseDefaultEmailAccount" DisplayName="Use Desktop Outlook App" sap:VirtualizedContainerService.HintSize="510,648" sap2010:WorkflowViewState.IdRef="OutlookApplicationCard_3">
<umab:OutlookApplicationCard.Body>
<ActivityAction x:TypeArguments="um:IMailQuickHandle">
<ActivityAction.Argument>
<DelegateInArgument x:TypeArguments="um:IMailQuickHandle" Name="Outlook" />
</ActivityAction.Argument>
<Sequence DisplayName="Do" sap:VirtualizedContainerService.HintSize="476,468" sap2010:WorkflowViewState.IdRef="Sequence_17">
<sap:WorkflowViewStateService.ViewState>
<scg:Dictionary x:TypeArguments="x:String, x:Object">
<x:Boolean x:Key="IsExpanded">True</x:Boolean>
</scg:Dictionary>
</sap:WorkflowViewStateService.ViewState>
<umab:SendMailX Bcc="{x:Null}" HtmlBodyFromText="{x:Null}" ReplyTo="{x:Null}" Account="[Outlook]" Body="[string.Format(varEmailSuccessTemplate, Now, varEmailReport)]" BodyType="Text" Cc="maxinexiong2@gmail.com" DisplayName="Private: Email final report to recipient" sap:VirtualizedContainerService.HintSize="434,380" sap2010:WorkflowViewState.IdRef="SendMailX_2" Importance="Normal" IsDraft="False" MaxBodyDocumentSizeMB="2" Sensitivity="Normal" Subject="Email Automation Report: Your 10 Most Recent Unread Emails" To="meenoxiong@gmail.com" UseDocumentAsBody="False">
<umab:SendMailX.Files>
<scg:List x:TypeArguments="InArgument(x:String)" Capacity="0" />
</umab:SendMailX.Files>
<umab:SendMailX.HtmlBodyFromFile>
<umabh:HtmlContentArgument FilePath=".data/HtmlContent0.html">
<umabh:HtmlContentArgument.RuntimeImages>
<scg:Dictionary x:TypeArguments="x:String, InArgument(x:String)" />
</umabh:HtmlContentArgument.RuntimeImages>
<umabh:HtmlContentArgument.ValueMappings>
<scg:List x:TypeArguments="umabh:HtmlValueMappingBase" Capacity="0" />
</umabh:HtmlContentArgument.ValueMappings>
</umabh:HtmlContentArgument>
</umab:SendMailX.HtmlBodyFromFile>
</umab:SendMailX>
</Sequence>
</ActivityAction>
</umab:OutlookApplicationCard.Body>
</umab:OutlookApplicationCard>
</Sequence>
</TryCatch.Finally>
</TryCatch>
</Sequence>
</Activity>