Your feedback matters, and we’ve been listening!
Many of you have been eager for a command to update the ‘isRead’ flag in emails. Starting with 4D v20 R3, 4D Netkit has incorporated this highly requested feature. Now, you can effortlessly update various properties of received or drafted emails using the new ‘Office365.mail.update()‘ function.
Keep reading for more details.
Account connection
Before starting, we will create the OAuth2 connection object and the Office 365 object.
var $oAuth2: cs.NetKit.OAuth2Provider
var $office365 : cs.NetKit.Office365
$oAuth2:=cs.NetKit.OAuth2Provider.new($credentials)
$office365:=cs.NetKit.Office365.new($oAuth2;\
{mailType: "Microsoft"})
Update mail
Microsoft Graph provides the capability to modify numerous attributes of your emails. However, it’s important to note that specific properties, such as the body or subject, can only be updated for emails in draft status.
As an illustration, if you want to change the ‘isRead’ status and add a category to your email using the ‘Office365.mail.update()’ function, you should write the following code:
var $property:={}
$property.isRead:=False
$property.categories:=["myCategory"]
$property.importance:="High"
$status:=$office365.mail.update($mailId; $property)
Explore the documentation for further insights into the new features!