-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi,
It is me again!
Would you be able to add in functionality to add delivery and read notifications. Currently i have modified your code as below but happy for you to devise another approach too.
Using SMTP headers, I check if read or delivery is needed and I set it
internal static Message CreateGraphMessageFromFluentEmail(IFluentEmail email)
{
var itemBody = new ItemBody
{
Content = email.Data.Body,
ContentType = email.Data.IsHtml ? BodyType.Html : BodyType.Text,
};
var message = new Message
{
Subject = email.Data.Subject,
Body = itemBody,
From = ConvertToRecipient(email.Data.FromAddress),
ReplyTo = CreateRecipientList(email.Data.ReplyToAddresses),
ToRecipients = CreateRecipientList(email.Data.ToAddresses),
CcRecipients = CreateRecipientList(email.Data.CcAddresses),
BccRecipients = CreateRecipientList(email.Data.BccAddresses),
};
SetPriority(email, message);
//Check if read receipt is needed
if(email.Data.Headers.ContainsKey("Return-Receipt-To"))
{
email.Data.Headers.Remove("Return-Receipt-To");
email.Data.Headers.Remove("Disposition-Notification-To");
message.IsDeliveryReceiptRequested = true;
message.IsReadReceiptRequested = true;
}
SetHeaders(email, message);
return message;
}
Thanks
Metadata
Metadata
Assignees
Labels
No labels