Fonctionality missing from Email Logging

Topics: Logging Application Block
Dec 18, 2007 at 10:52 AM
Hi, I really have a big problem, I need to have the machine name in the subject of the email sent, a little like the formatter does with the body, but also applied to the subject. It doesn't do that at the moment (sounds like a very obvious thing missing), and I need to find some way of doing it.
Is there a third party email provider that would do it already ? or else is it possible (read not too difficult) to modifiy the existing one to do it ?

Any help very much appreciated.
Dec 18, 2007 at 11:59 AM

There is no such implementation AFAIK, but it should be fairly simple to create a new one or modify the existing one (if you want to build your own version of the binaries). Changes need to be made in several places though.

The cleanest approach would be to add a second formatter for the subject. This requires:
  • Changing the EmailTraceListenerData to add the new SubjectFormatter property replacing the previous SubjectLineEnder and SubjectLineStarter
  • Changing the EmailTraceListenerNode to support configuring this new formatter. Again a new property must replace the two existing one, but now some extra code needs to be added to manage the new linking to the formatter node. Cloning the code that already does it for the body formatter should be enough (take care to use a new set of handlers for the subject formatter node's rename/delete events)
  • Changing the EmailTraceListener in a similar fashion. A new subjectFormatter field would replace the subject start and end fields, and it would be passed along to the EmailMessage.
  • Changing the EmailMessage to receive the subject formatter and use it when building the subject in the method CreateMailMessage, instead of the GenerateSubjectPrefix/GenerateSubjectSuffix, by doing the same processing it already does with the body but with the new formatter.

Logging this as a feature request.

Hope this helps,
Dec 18, 2007 at 12:00 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.