Reputation: 509
I have a strange requirement: when a user sends an email from his/her Lotus Notes client, I need to do some checks on the SendTo and CopyTo fields and prompt the user with a message. An example might be, if I see external email addresses in those fields, to prompt the user with a warning. Or if I see email addresses of a specific domain, to prompt the user with some different message.
Also, this needs to be pushed to some users. Not all.
I can modify the Mail Template and code this in there no problem. I can also have a separate Mail Template for those users that need this functionality and leave all others in the Standard Mail Template. But modifying the Template is not a good idea for future changes/enhancements. When servers are updated, you need to move your custom code, refresh designs etc etc. Not good.
So I am thinking of building an eclipse plug-in for this. Feels like this would be the ideal option. No need to modify the template, and the plug-in can be pushed out to specific users. I have never done client side plug-ins (although I have pretty good experience with server side OSGi plug-ins, (old DOTS etc)), so there is going to be a lot of reading and try. But before I start digging, anybody knows if it is possible to "trap" the Send button action in Lotus Notes client with an eclipse plug-in? If not the Send button, is it possible to "trap" the SendMail function in general in Lotus Notes client with an eclipse plug-in so that I can do my checks there and prompt the user?
If yes, documentation-wise, where do you start?
Upvotes: 0
Views: 74
Reputation: 397
I agree with Torsten. A custom mail template is the way to go. It also has the benefit of being able to show a warning before the user hits 'send'
Upvotes: 0
Reputation: 14628
You can trap the MailSend function (or any other method of depositing mail) by building an Extension Manager plugin DLL using the Notes C API to set triggers on the NSFNoteUpdate operation in the mail.box file. This is non-trivial, though it can be made somewhat easier if you use the old Trigger Happy project on OpenNTF.
But seriously, I don't recommend this. You'll have to build, install, and support new code on every Notes client machine, and you're doing nothing about users sending from the web or from mobile clients. You haven't really described your actual requirement here, so it's hard to recommend what you should do instead, but I have to wonder first whether there are any third party mail management products for Notes/Domino still on the market that might provide all the hooks you need.
Upvotes: 0
Reputation: 12060
No, that is not possible via Eclipse plugin. But really: why would you need that? I customize mail templates for my customers since over 20 years. And for most of them I had to modify 5-6 templates in that time. Mail templates do not change to often though HCL currently releases one major version every year.
If you put your code into a Script Library, document your changes well and encapsulate buttons and stuff in a subform, then it is usually a matter of hours to adapt the features for a new mailtemplate...
Keep it simple: put the code where it belongs and make your life easy by using the right amount of inheritance...
Upvotes: 1