Microsoft 365: Update Mail Properties

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!

Fabrice Mainguené
• Product Owner •Fabrice Mainguené joined 4D Program team in November, 2016. As a Product Owner, he is in charge of writing the user stories then translating it to functional specifications. His role is also to make sure that the feature implementation delivered is meeting the customer need.After obtaining a Bachelor degree in Computer Science at CNAM, Fabrice joined a small software publishing company as a Windev developer. Then he worked for different companies in industry and trade areas as a Windev and web developer as well as technical advisor on new features.