Hi @Harry Jaggard ,
Hope you are doing well.
We can create Message Rule using below graph api endpoint.
Please refer mailfolder-post-messagerules microsoft article for the same.
Outlook carries out those actions if an incoming message in the user's Inbox meets the specified conditions.
Permissions
Delegated (work or school account) MailboxSettings.ReadWrite
Delegated (personal Microsoft account) MailboxSettings.ReadWrite
Application MailboxSettings.ReadWrite
Graph API Endpoint
POST https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messageRules
Request Header
Content-type: application/json
Request Body
{
"displayName": "Keyword Rule",
"sequence": 1,
"isEnabled": true,
"conditions": {
"bodyContains": [
"test"
]
},
"actions": {
"forwardTo": [
{
"emailAddress": {
"name": "User Name",
"address": "user@o365xx.onmicrosoft.com"
}
}
],
"stopProcessingRules": true
}
}
Graph API Response
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('6ab5cc33-a9d6-40b1-a84f-993e06d170f3')/mailFolders('inbox')/messageRules/$entity",
"id": "AQAAAEegLYU=",
"displayName": "Keyword Rule",
"sequence": 1,
"isEnabled": true,
"hasError": false,
"isReadOnly": false,
"conditions": {
"bodyContains": [
"test"
]
},
"actions": {
"stopProcessingRules": true,
"forwardTo": [
{
"emailAddress": {
"name": "User Name",
"address": "user@o365xx.onmicrosoft.com"
}
}
]
}
}
So in this way you can forward email that contains specific keyword to another user with webmail
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".