![]() |
AlarmNotifications
PANDA Slow Control Alarm Daemon
|
Send alarm notifications via e-mail. More...
#include <emailsender.h>
Public Member Functions | |
~EMailSender () | |
Destructor. More... | |
EMailSender (const EMailSender &other)=delete | |
Copy constructor (deleted) More... | |
EMailSender (EMailSender &&other)=delete | |
Move constructor (C++11, deleted) More... | |
EMailSender & | operator= (const EMailSender &other)=delete |
Copy assignment (deleted) More... | |
EMailSender & | operator= (EMailSender &&other)=delete |
Move assignment (C++11, deleted) More... | |
Static Public Member Functions | |
static EMailSender & | instance () noexcept |
Get singleton instance. More... | |
static void | sendAlarmNotification (const std::vector< AlarmStatusEntry > alarms) noexcept |
Send an alarm notification via e-mail. More... | |
Private Member Functions | |
EMailSender () | |
Constructor. More... | |
void | sendAlarmNotification_internal (const std::vector< AlarmStatusEntry > alarms) |
Compose and send the e-mail notification. More... | |
QString | composeMessageText (const std::vector< AlarmStatusEntry > &alarms) |
Compose message text. More... | |
Send alarm notifications via e-mail.
This class encapsulates the code that produces an e-mail notification that can be sent to a mailing list to inform the staff about an alarm that occured while nobody was in the laboratory.
The actual SMTP client work is done by the classes of the SmtpClient-for-Qt project, The code has been written by "bluetiger9" on GitHub and is available here: https://www.github.com/bluetiger9/SmtpClient-for-Qt. It is licensed unter the GNU Lesser General Public License, version 2.1.
The task of this class is to compose the message text and instruct the SmtpClient properly to have the e-mail sent. The parameters for the connection to the SMTP server are read from the AlarmConfiguration class.
Definition at line 57 of file emailsender.h.
|
private |
EMailSender::~EMailSender | ( | ) |
|
delete |
Copy constructor (deleted)
This class cannot be copied.
other | Another instance of EMailSender |
|
delete |
Move constructor (C++11, deleted)
This class cannot be moved.
other | Another instance of EMailSender |
|
private |
Compose message text.
This method creates the text to be put into the body of the alarm notification e-mail.
alarms | Alarm to be listed in the e-mail |
Definition at line 123 of file emailsender.cpp.
|
staticnoexcept |
Get singleton instance.
Returns a reference (not a pointer) to the single global instance of this class.
Definition at line 47 of file emailsender.cpp.
|
delete |
Copy assignment (deleted)
This class cannot be copied.
other | Another instance of EMailSender |
|
delete |
Move assignment (C++11, deleted)
This class cannot be moved.
other | Another instance of EMailSender |
|
staticnoexcept |
Send an alarm notification via e-mail.
This static method gets a reference to the global instance of EMailSender and invokes sendAlarmNotification_internal() to send an e-mail to tell the staff about the alarms.
alarms | Alarms to be listed in the e-mail |
Definition at line 53 of file emailsender.cpp.
|
private |
Compose and send the e-mail notification.
This method is invoked by sendAlarmNotification() and does the actual work. It reads the necessary configuration parameters, creates a connection to the SMTP server, assembles the e-mail message and sends it.
alarms | Alarms to be listed in the e-mail |
Definition at line 78 of file emailsender.cpp.