-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de53115
commit a22239b
Showing
3 changed files
with
36 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ Alternatively, you can clone this repository, build the executable yourself and | |
- Social Media Report | ||
- Office of Research | ||
- Office of International Relations | ||
- HASS Events | ||
|
||
### Rules | ||
|
||
|
@@ -55,15 +56,16 @@ Alternatively, you can clone this repository, build the executable yourself and | |
- Server-Side: | ||
- Filter and move all emails with sender addresses that contain `club.sutd.edu.sg` to the Student Clubs folder. | ||
- Filter and move all emails with sender addresses that contain `marcom.sutd.edu.sg` to the Office of Marketing folder. | ||
- Filter and move all emails from `[email protected]` to the Career Development Centre folder. | ||
- Filter and move all emails from [`[email protected]`](mailto:[email protected]) to the Career Development Centre folder. | ||
- Filter and move all emails with subjects that contain `Whatz Newz by Office of Student Life` to the Whatz Newz folder. | ||
- Filter and move all emails from `[email protected]` to the Library folder. | ||
- Filter and move all emails from [`[email protected]`](mailto:[email protected]) to the Library folder. | ||
- Filter and move all emails with sender addresses that contain `studentgov.sutd.edu.sg` to the Student Government folder. | ||
- Filter and move all emails sent to `*[email protected]` to the All Students folder. | ||
- Filter and move all emails sent to [`*[email protected]`](mailto:*[email protected]) to the All Students folder. | ||
- Filter and move all emails with subjects that contain `Summary of coverage: Highlights of SUTD` to the News Coverage folder. | ||
- Filter and move all emails with subjects that contain `SUTD's Social Media Report` to the Social Media Report folder. | ||
- Filter and move all emails from `[email protected]` to the Office of Research folder. | ||
- Filter and move all emails from `[email protected]` to the Office of International Relations folder. | ||
- Filter and move all emails from [`[email protected]`](mailto:[email protected]) to the Office of Research folder. | ||
- Filter and move all emails from [`[email protected]`](mailto:[email protected]) to the Office of International Relations folder. | ||
- Filter and move all emails from [`[email protected]`](mailto:[email protected]) to the HASS Events folder. | ||
|
||
## Feedback | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,7 +214,8 @@ public void CreateFolders() | |
newsCoverageFolder = null, | ||
socialMediaReportFolder = null, | ||
researchFolder = null, | ||
intlRelationsFolder = null; | ||
intlRelationsFolder = null, | ||
hassEventsFolder = null; | ||
Outlook.Folders rootFolderFolders = null, | ||
othersSubfolders = null; | ||
|
||
|
@@ -246,6 +247,7 @@ public void CreateFolders() | |
socialMediaReportFolder = GetSubFolder(@"Social Media Report", othersFolder, application); | ||
researchFolder = GetSubFolder(@"Office of Research", othersFolder, application); | ||
intlRelationsFolder = GetSubFolder(@"Office of International Relations", othersFolder, application); | ||
hassEventsFolder = GetSubFolder(@"HASS Events", othersFolder, application); | ||
} | ||
catch (Exception ex) | ||
{ | ||
|
@@ -269,6 +271,7 @@ public void CreateFolders() | |
ReleaseComObject(socialMediaReportFolder); | ||
ReleaseComObject(researchFolder); | ||
ReleaseComObject(intlRelationsFolder); | ||
ReleaseComObject(hassEventsFolder); | ||
ReleaseComObject(store); | ||
ReleaseComObject(session); | ||
} | ||
|
@@ -549,6 +552,30 @@ public void CreateRules() | |
|
||
rules.Save(true); | ||
} | ||
|
||
string hassEventsRuleName = "HASS Events Emails"; | ||
|
||
if (!RuleExist(hassEventsRuleName, rules)) | ||
{ | ||
Outlook.MAPIFolder destinationFolder = GetFolder(rootFolder.FolderPath + @"\Others\HASS Events", application); | ||
|
||
Outlook.Rule rule = rules.Create(hassEventsRuleName, Outlook.OlRuleType.olRuleReceive); | ||
Outlook.RuleConditions ruleConditions = rule.Conditions; | ||
|
||
Outlook.ToOrFromRuleCondition senderAddressRuleCondition = ruleConditions.From; | ||
senderAddressRuleCondition.Recipients.Add("[email protected]"); | ||
senderAddressRuleCondition.Recipients.ResolveAll(); | ||
senderAddressRuleCondition.Enabled = true; | ||
|
||
Outlook.RuleActions ruleActions = rule.Actions; | ||
Outlook.MoveOrCopyRuleAction moveRuleAction = ruleActions.MoveToFolder; | ||
moveRuleAction.Folder = destinationFolder; | ||
moveRuleAction.Enabled = true; | ||
|
||
ruleActions.Stop.Enabled = true; | ||
|
||
rules.Save(true); | ||
} | ||
} | ||
catch (Exception ex) | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters