Skip to content

Commit 16bd46d

Browse files
committed
Add new Fabrication Lab rule
1 parent 9915860 commit 16bd46d

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Alternatively, you can clone this repository, build the executable yourself and
5555
- UROP
5656
- UTOP
5757
- IAP Admin
58+
- Fabrication Lab
5859

5960
### Rules
6061

@@ -80,6 +81,7 @@ Alternatively, you can clone this repository, build the executable yourself and
8081
- Filter and move all emails from [`urop@sutd.edu.sg`](mailto:urop@sutd.edu.sg) to the UROP folder.
8182
- Filter and move all emails from [`utop@sutd.edu.sg`](mailto:utop@sutd.edu.sg) to the UTOP folder.
8283
- Filter and move all emails from [`iapadmin@sutd.edu.sg`](mailto:iapadmin@sutd.edu.sg) to the IAP Admin folder.
84+
- Filter and move all emails from [`fablab@sutd.edu.sg`](mailto:fablab@sutd.edu.sg) to the Fabrication Lab folder.
8385

8486
## Feedback
8587

SUTDigest/OutlookWrapper.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ public void CreateFolders()
222222
wellbeingFolder = null,
223223
uropFolder = null,
224224
utopFolder = null,
225-
iapAdminFolder = null;
225+
iapAdminFolder = null,
226+
fablabFolder = null;
226227
Outlook.Folders rootFolderFolders = null,
227228
othersSubfolders = null;
228229

@@ -262,6 +263,7 @@ public void CreateFolders()
262263
uropFolder = GetSubFolder(@"UROP", othersFolder, application);
263264
utopFolder = GetSubFolder(@"UTOP", othersFolder, application);
264265
iapAdminFolder = GetSubFolder(@"IAP Admin", othersFolder, application);
266+
fablabFolder = GetSubFolder(@"Fabrication Lab", othersFolder, application);
265267
}
266268
catch (Exception ex)
267269
{
@@ -293,6 +295,7 @@ public void CreateFolders()
293295
ReleaseComObject(uropFolder);
294296
ReleaseComObject(utopFolder);
295297
ReleaseComObject(iapAdminFolder);
298+
ReleaseComObject(fablabFolder);
296299
ReleaseComObject(store);
297300
ReleaseComObject(session);
298301
}
@@ -765,6 +768,30 @@ public void CreateRules()
765768

766769
rules.Save(true);
767770
}
771+
772+
string fablabRuleName = "Fabrication Lab Emails";
773+
774+
if (!RuleExist(fablabRuleName, rules))
775+
{
776+
Outlook.MAPIFolder destinationFolder = GetFolder(rootFolder.FolderPath + @"\Others\Fabrication Lab", application);
777+
778+
Outlook.Rule rule = rules.Create(fablabRuleName, Outlook.OlRuleType.olRuleReceive);
779+
Outlook.RuleConditions ruleConditions = rule.Conditions;
780+
781+
Outlook.ToOrFromRuleCondition senderAddressRuleCondition = ruleConditions.From;
782+
senderAddressRuleCondition.Recipients.Add("fablab@sutd.edu.sg");
783+
senderAddressRuleCondition.Recipients.ResolveAll();
784+
senderAddressRuleCondition.Enabled = true;
785+
786+
Outlook.RuleActions ruleActions = rule.Actions;
787+
Outlook.MoveOrCopyRuleAction moveRuleAction = ruleActions.MoveToFolder;
788+
moveRuleAction.Folder = destinationFolder;
789+
moveRuleAction.Enabled = true;
790+
791+
ruleActions.Stop.Enabled = true;
792+
793+
rules.Save(true);
794+
}
768795
}
769796
catch (Exception ex)
770797
{

SUTDigest/SUTDigest.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Description>SUTD Outlook Mail Classifier/Organizer.</Description>
1212
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
1313
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
14-
<Version>1.0.9</Version>
14+
<Version>1.0.10</Version>
1515
<PackageTags></PackageTags>
1616
<RepositoryUrl>https://github.com/jamestiotio/SUTDigest</RepositoryUrl>
1717
<PackageProjectUrl>https://github.com/jamestiotio/SUTDigest</PackageProjectUrl>

0 commit comments

Comments
 (0)