Improving the Mail Template in 12.0.x and 14.0 - Manage Return Receipts according to RFC 2298
Thomas Hampel
24 September 2024Just a short revisit of a previous blog post which I wrote 7 years ago based on a friendly request from a customer.
mail-template-9.0.1-feature-pack-9-manage-return-receipts-according-to-rfc-2298.htm
The code below is almost the same. It is just now avoiding to introduce a new variable named 'doc' and it is put at the beginning of the event to also cover situations where the document is opened in preview mode.
According to RFC 2298 http://www.ietf.org/rfc/rfc2298.txt it is recommended to show a dialog box where the recipient of a mail can decide weather or not a return receipt shall be sent back to the originator of the mail.
This behavior is not currently part of the Standard HCL Mail template.
To add this feature you have to modify the following design elements:
- Form “Memo”, Event "QueryOpenDocument", added the code shown below
- Form “Reply”, Event "QueryOpenDocument", added the code shown below
- Form “Reply With History”, Event "QueryOpenDocument", added the code shown below
Insert this code at the BEGINNING of the QueryOpenDocument event.
If Source.isNewDoc Then
'# don' t do anything, as this is a new document
Else
If Source.document.GetItemValue("ReturnReceipt")(0) = "1" And Source.document.HasItem ("DeliveredDate") Then
If Messagebox ("The sender of this message has asked to be notified when you read this message." & Chr(13) & "Do you wish to notify the sender?", 36, "Send Return Receipt?") = 7 Then
Call Source.document.ReplaceItemValue ("ReturnReceipt", "0")
Call Source.document.Save(True, False, True)
End If
End If
End If
For clarity, this is what the QueryOpen event looks like BEFORE the modification:
and AFTER the modification it looks like this: