The email notification module was created on behalf of Intelligen Inc. in order to support task email notifications for the SchedulePro application. The module is used by clients in production to notify plant floor operators and shift leaders of upcoming tasks. The application core is written in VC++/MFC, but this module is written in C#/WPF, in an external .NET library. Communication between the application core and the emailing module is done in C++/CLI.
Functionality at a glance:
- Provides email address book allowing for creating individual contacts or contact groups.
- Contact groups consist of individual contacts and allow for easily emailing multiple people.
- Allows for setting email entries for key schedule reference points. Entries consist of:
- The time prior to or after the reference point when the email must be sent.
- The message to be sent.
- The list of individual users or groups the email will be sent to.
- Allows for automatically sending the email to all involved staff as determined by the scheduling subsystem of the application (unrelated to the address book).
Technical Overview:
- The module interfaces are a group of WPF windows written in C#. The main address book window is opened from the core C++/CLI application.
- The module data are stored in a SQL Server database and accessed through Entity Framework.
- The actual emailing functionality is implemented in C# using async/await (for non-blocking network communication) and is initiated from the core C++/CLI.
- Uses two classes: EmailMessage and Emailing
- Is implemented with a thread-safe singleton pattern (uses a lock object) with an email queue, where outgoing email messages are stored.
- Enqueues outstanding emails and marks sent emails. In case of errors, it supports retrying sending an email a number of times before aborting.
- The SMTP settings are configured in the main VC++/MFC application.