HomeWaterLeaksDetection
EmailSender Class Reference

#include <EmailSender.h>

Public Types

enum  Type {
  BOOTING, DAILY_OVERVIEW, LEAK_DETECTED, VALVE_STATE,
  RESET, ALARM, CHANGED_SETTINGS, APPLIED_NEW_SETTING,
  BYPASS, COUNT = 9
}
 different types of e-mail that can be sent to the user More...
 

Public Member Functions

void sendEmail (Type type, String subject, String data)
 Sends an e-mail to the smtp2go server. More...
 
void enableNotification (Type type, bool state)
 Enables/disables the particular type of e-mail notification. More...
 
void setReceiverEmailAddress (String email)
 Changes the user's e-mail address. More...
 
String getFormatOfSettingsToSave ()
 Returns settings. More...
 
const String getHTMLData (const int id) const
 Since this class is registered as a source of data for the HTML content, it needs return the appropriate value according to the id given as a parameter. More...
 

Static Public Member Functions

static EmailSendergetInstance ()
 Returns the instance of the class. More...
 

Private Member Functions

 EmailSender ()
 Constructor of the class. More...
 
 ~EmailSender ()
 Descrutor of the class. More...
 
 EmailSender (EmailSender const &)
 Copy constructor of the class. More...
 
EmailSenderoperator= (EmailSender const &)
 Assignmet operator of the class. More...
 
int setEthernet ()
 Initializes the ethernet shield. More...
 
byte eRcv ()
 Reads data using the ethernet client comming from the smtp2go server. More...
 
void efail ()
 Closes the ethernet client after the connection has failed. More...
 
byte sendEmail (String subject, String data)
 Sends an e-mail off to the smtp2go server. More...
 

Private Attributes

std::map< Type, bool > enabled
 map holding info about each time of e-mail - whether it's enabled or not More...
 
EthernetClient client
 EthernetClient used to connect to the smt2go server. More...
 
byte mac [6] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 }
 mac address of the ethernet shield More...
 
String receiverEmailAddress = "jakub.sil@seznam.cz"
 the default user's email address More...
 
std::map< int, String(*)(const EmailSender &leaksController)> htmlData
 A map of different values (keys) and their associated functions which returns the appropriate values. More...
 

Static Private Attributes

static EmailSenderinstance = NULL
 the instance of EmailSender More...
 

Friends

String HTML_Notification_BOOTING (const EmailSender &emailSender)
 Associated function for returing the state of the 'bootup' notification. More...
 
String HTML_Notification_DAILY_OVERVIEW (const EmailSender &emailSender)
 Associated function for returing the state of the 'daily overview' notification. More...
 
String HTML_Notification_LEAK_DETECTED (const EmailSender &emailSender)
 Associated function for returing the state of the 'leak detected' notification. More...
 
String HTML_Notification_VALVE_STATE (const EmailSender &emailSender)
 Associated function for returing the state of the 'valve state' notification. More...
 
String HTML_Notification_RESET (const EmailSender &emailSender)
 Associated function for returing the state of the 'system reset' notification. More...
 
String HTML_Notification_ALARM (const EmailSender &emailSender)
 Associated function for returing the state of the 'home alarm state' notification. More...
 
String HTML_Notification_CHANGED_SETTINGS (const EmailSender &emailSender)
 Associated function for returing the state of the 'changed settings' notification. More...
 
String HTML_Notification_APPLIED_NEW_SETTING (const EmailSender &emailSender)
 Associated function for returing the state of the 'applied settings' notification. More...
 
String HTML_Notification_BYPASS (const EmailSender &emailSender)
 Associated function for returing the state of the 'bypass state' notification. More...
 
String HTML_ReceiverEmailAddress (const EmailSender &emailSender)
 Associated function for returing the user's e-mail address. More...
 

Additional Inherited Members

- Static Public Attributes inherited from HTMLDataSource
static const String UNDEFINED_DATA = String("UNDEFINED")
 string "UNDEFINED" More...
 

Detailed Description

Author
silhavyj A17B0362P

This calass is designed as a Singleton and is used for sending e-mails to the user.

Definition at line 35 of file EmailSender.h.

Member Enumeration Documentation

◆ Type

different types of e-mail that can be sent to the user

Enumerator
BOOTING 

when the system boots up

DAILY_OVERVIEW 

daily overview about the system

LEAK_DETECTED 

when a leak has been detected

VALVE_STATE 

when the state of the valve has changed

RESET 

when the device resets

ALARM 

when the state of the home alarm changes

CHANGED_SETTINGS 

when the user changes settings

APPLIED_NEW_SETTING 

when the new settings are applied

BYPASS 

when a bypass changes

COUNT 

total number of different kinds of e-mails

Definition at line 44 of file EmailSender.h.

44  {
45  BOOTING,
48  VALVE_STATE,
49  RESET,
50  ALARM,
53  BYPASS,
54 
55  COUNT = 9
56  };

Constructor & Destructor Documentation

◆ EmailSender() [1/2]

EmailSender::EmailSender ( )
private

Constructor of the class.

Definition at line 47 of file EmailSender.cpp.

47  {
48  if (Ethernet.linkStatus() != LinkON) {
49  if (!setEthernet())
50  return;
51  }
52  // by default disable all e-mail notifications
53  enabled[BOOTING] = false;
54  enabled[DAILY_OVERVIEW] = false;
55  enabled[LEAK_DETECTED] = false;
56  enabled[VALVE_STATE] = false;
57  enabled[RESET] = false;
58  enabled[ALARM] = false;
59  enabled[CHANGED_SETTINGS] = false;
61  enabled[BYPASS] = false;
62 
63  #ifdef WEB_SERVER
64  // functions providing data to the webserver
75  #endif
76 }

References ALARM, APPLIED_NEW_SETTING, BOOTING, BYPASS, CHANGED_SETTINGS, DAILY_OVERVIEW, enabled, HTML_Notification_ALARM, HTML_Notification_APPLIED_NEW_SETTING, HTML_Notification_BOOTING, HTML_Notification_BYPASS, HTML_Notification_CHANGED_SETTINGS, HTML_Notification_DAILY_OVERVIEW, HTML_Notification_LEAK_DETECTED, HTML_Notification_RESET, HTML_Notification_VALVE_STATE, HTML_ReceiverEmailAddress, htmlData, LEAK_DETECTED, RESET, setEthernet(), and VALVE_STATE.

Referenced by getInstance().

◆ ~EmailSender()

EmailSender::~EmailSender ( )
private

Descrutor of the class.

◆ EmailSender() [2/2]

EmailSender::EmailSender ( EmailSender const &  )
inlineprivate

Copy constructor of the class.

Definition at line 76 of file EmailSender.h.

76 {};

Member Function Documentation

◆ efail()

void EmailSender::efail ( )
private

Closes the ethernet client after the connection has failed.

Definition at line 223 of file EmailSender.cpp.

223  {
224  byte thisByte = 0;
225  int loopCount = 0;
226  client.println(F("QUIT"));
227  while (!client.available()) {
228  delay(1);
229  loopCount++;
230  if (loopCount > 10000) {
231  client.stop();
232  #ifdef DEBUG
233  Serial.println("\r\nTimeout");
234  #endif
235  return;
236  }
237  }
238  while (client.available()) {
239  thisByte = client.read();
240  Serial.write(thisByte);
241  }
242  client.stop();
243  #ifdef DEBUG
244  Serial.println("disconnected");
245  #endif
246 }

References client.

Referenced by eRcv().

◆ enableNotification()

void EmailSender::enableNotification ( Type  type,
bool  state 
)

Enables/disables the particular type of e-mail notification.

Parameters
typeof e-mail notification
statetrue/false - enable/disable

Definition at line 43 of file EmailSender.cpp.

43  {
44  enabled[type] = state;
45 }

References enabled.

Referenced by setSettingsNotification().

◆ eRcv()

byte EmailSender::eRcv ( )
private

Reads data using the ethernet client comming from the smtp2go server.

Returns
0 if the reading fails, otherwise 1

Definition at line 192 of file EmailSender.cpp.

192  {
193  byte respCode;
194  byte thisByte;
195  int loopCount = 0;
196 
197  while (!client.available()) {
198  delay(1);
199  loopCount++;
200 
201  if (loopCount > 10000) {
202  client.stop();
203  #ifdef DEBUG
204  Serial.println("\r\nTimeout");
205  #endif
206  return 0;
207  }
208  }
209  respCode = client.peek();
210  while (client.available()) {
211  thisByte = client.read();
212  #ifdef DEBUG
213  Serial.write(thisByte);
214  #endif
215  }
216  if (respCode >= '4') {
217  efail();
218  return 0;
219  }
220  return 1;
221 }

References client, and efail().

Referenced by sendEmail().

◆ getFormatOfSettingsToSave()

String EmailSender::getFormatOfSettingsToSave ( )

Returns settings.

It returns the user's e-mail address as well as information about which e-mail notifications are enabled/disabled so they can be stored on the SD card.

Returns
settings in a string format

Definition at line 248 of file EmailSender.cpp.

248  {
249  return String(enabled[BOOTING]) + ";" +
250  String(enabled[DAILY_OVERVIEW]) + ";" +
251  String(enabled[LEAK_DETECTED]) + ";" +
252  String(enabled[VALVE_STATE]) + ";" +
253  String(enabled[RESET]) + ";" +
254  String(enabled[ALARM]) + ";" +
255  String(enabled[CHANGED_SETTINGS]) + ";" +
256  String(enabled[APPLIED_NEW_SETTING]) + ";" +
257  String(enabled[BYPASS]) + ";" +
258  receiverEmailAddress + ";"; // user's e-mail address
259 }

References ALARM, APPLIED_NEW_SETTING, BOOTING, BYPASS, CHANGED_SETTINGS, DAILY_OVERVIEW, enabled, LEAK_DETECTED, receiverEmailAddress, RESET, and VALVE_STATE.

Referenced by WebServer::saveSettings().

◆ getHTMLData()

const String EmailSender::getHTMLData ( const int  id) const
virtual

Since this class is registered as a source of data for the HTML content, it needs return the appropriate value according to the id given as a parameter.

Parameters
id- the id of the piece of data
Returns
If the class holds this piece of information, it will return it. Otherwise, "UNDEFINED" will be returned.

Implements HTMLDataSource.

◆ getInstance()

EmailSender * EmailSender::getInstance ( )
static

Returns the instance of the class.

Returns
the instance of EmailSender

Definition at line 87 of file EmailSender.cpp.

87  {
88  if (instance == NULL)
89  instance = new EmailSender;
90  return instance;
91 }

References EmailSender(), and instance.

Referenced by WebServer::saveSettings(), setSettingsNotification(), setup(), LowLeakDetection::update(), HighLeakDetection::update(), DailyOverview::update(), and LeaksController::update().

◆ operator=()

EmailSender& EmailSender::operator= ( EmailSender const &  )
inlineprivate

Assignmet operator of the class.

Definition at line 79 of file EmailSender.h.

79 { return *this; }

◆ sendEmail() [1/2]

byte EmailSender::sendEmail ( String  subject,
String  data 
)
private

Sends an e-mail off to the smtp2go server.

Parameters
subjectof the e-mail
datacontent of the e-mail
Returns
1 if the e-mail has been sent off successfully, 0 otherwise.

Definition at line 93 of file EmailSender.cpp.

93  {
94  // connecting to the server
95  int success = client.connect(SMTPServerAddress, SMTPServerPort);
96  #ifdef DEBUG
97  if (success == 0)
98  Serial.println("connected to the SMTPServer");
99  else Serial.println("connection to the SMTPServer failed");
100  #endif
101  if (success != 1)
102  return 0;
103 
104  if (!eRcv())
105  return 0;
106 
107  // sending the "HELLO" message
108  #ifdef DEBUG
109  Serial.println("Sending hello");
110  #endif
111  client.println("EHLO " + String(arduinoIP));
112  if (!eRcv())
113  return 0;
114 
115  // sending a message to authenticate
116  #ifdef DEBUG
117  Serial.println("Sending auth login");
118  #endif
119  client.println("auth login");
120  if (!eRcv())
121  return 0;
122 
123  // sending the login
124  #ifdef DEBUG
125  Serial.println(("Sending User"));
126  #endif
127  client.println(auth64Login);
128  if (!eRcv())
129  return 0;
130 
131  // sending the password
132  #ifdef DEBUG
133  Serial.println(F("Sending Password"));
134  #endif
135  client.println(auth64Pass);
136  if (!eRcv())
137  return 0;
138 
139  // sending the sender's email address
140  #ifdef DEBUG
141  Serial.println("Sending From");
142  #endif
143  client.println("MAIL From: <" + String(emailAddress) + ">");
144  if (!eRcv())
145  return 0;
146 
147  // sending the receiver's email address
148  #ifdef DEBUG
149  Serial.println("Sending To");
150  #endif
151  client.println("RCPT To: <" + String(receiverEmailAddress) + ">");
152  if (!eRcv())
153  return 0;
154 
155  // starting sending data
156  #ifdef DEBUG
157  Serial.println("Sending DATA");
158  #endif
159  client.println("DATA");
160  if (!eRcv())
161  return 0;
162 
163  // sending the e-mail
164  #ifdef DEBUG
165  Serial.println("Sending email");
166  #endif
167  client.println("To: User <" + String(receiverEmailAddress) + ">");
168  client.println("From: Home Water Leaks Detection <" + String(emailAddress) + ">");
169 
170  client.println("Subject: " + subject); // subject
171  client.println(data); // body
172  client.println("."); // end of the e-mail
173  if (!eRcv())
174  return 0;
175 
176  // log out
177  #ifdef DEBUG
178  Serial.println("Sending QUIT");
179  #endif
180  client.println("QUIT");
181  if (!eRcv())
182  return 0;
183 
184  // close the connection
185  client.stop();
186  #ifdef DEBUG
187  Serial.println("disconnected");
188  #endif
189  return 1;
190 }

References arduinoIP, auth64Login, auth64Pass, client, emailAddress, eRcv(), receiverEmailAddress, SMTPServerAddress, and SMTPServerPort.

Referenced by sendEmail(), setup(), LowLeakDetection::update(), HighLeakDetection::update(), DailyOverview::update(), and LeaksController::update().

◆ sendEmail() [2/2]

void EmailSender::sendEmail ( Type  type,
String  subject,
String  data 
)

Sends an e-mail to the smtp2go server.

Parameters
typeof the e-mail
subjectof the e-mail
datacontent of the e-mail

Definition at line 78 of file EmailSender.cpp.

78  {
79  if (enabled[type])
80  sendEmail(subject, data);
81 }

References enabled, and sendEmail().

◆ setEthernet()

int EmailSender::setEthernet ( )
private

Initializes the ethernet shield.

This method initializes the the ethernet shield only if it has not been initialized yet.

Returns
1 if the shield has been initialized successfully, 0 otherwise.

Definition at line 18 of file EmailSender.cpp.

18  {
19  pinMode(SS_SD_CARD, OUTPUT);
20  pinMode(SS_ETHERNET, OUTPUT);
21  digitalWrite(SS_SD_CARD, HIGH); // SD Card not active
22  digitalWrite(SS_ETHERNET, HIGH); // Ethernet not active
23 
24  Ethernet.begin(mac); // set the mac addr of the ethernet shield
25 
26  // HW not found error
27  if (Ethernet.hardwareStatus() == EthernetNoHardware) {
28  #ifdef DEBUG
29  Serial.println("Ethernet shield was not found");
30  #endif
31  return 0;
32  }
33  // cable is not connected error
34  if (Ethernet.linkStatus() == LinkOFF) {
35  #ifdef DEBUG
36  Serial.println("Ethernet cable is not connected.");
37  #endif
38  return 0;
39  }
40  return 1;
41 }

References mac, SS_ETHERNET, and SS_SD_CARD.

Referenced by EmailSender().

◆ setReceiverEmailAddress()

void EmailSender::setReceiverEmailAddress ( String  email)

Changes the user's e-mail address.

Parameters
emailthe new e-mail address all e-mails will be sent to

Definition at line 83 of file EmailSender.cpp.

83  {
84  this->receiverEmailAddress = email;
85 }

References receiverEmailAddress.

Referenced by setSettingsNotification().

Friends And Related Function Documentation

◆ HTML_Notification_ALARM

String HTML_Notification_ALARM ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'home alarm state' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_Notification_APPLIED_NEW_SETTING

String HTML_Notification_APPLIED_NEW_SETTING ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'applied settings' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_Notification_BOOTING

String HTML_Notification_BOOTING ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'bootup' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_Notification_BYPASS

String HTML_Notification_BYPASS ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'bypass state' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_Notification_CHANGED_SETTINGS

String HTML_Notification_CHANGED_SETTINGS ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'changed settings' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_Notification_DAILY_OVERVIEW

String HTML_Notification_DAILY_OVERVIEW ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'daily overview' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_Notification_LEAK_DETECTED

String HTML_Notification_LEAK_DETECTED ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'leak detected' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_Notification_RESET

String HTML_Notification_RESET ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'system reset' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_Notification_VALVE_STATE

String HTML_Notification_VALVE_STATE ( const EmailSender emailSender)
friend

Associated function for returing the state of the 'valve state' notification.

Parameters
emailSender- the instance of the EmailSender class
Returns
"checked" if the notification is enabled, "" otherwise

Referenced by EmailSender().

◆ HTML_ReceiverEmailAddress

String HTML_ReceiverEmailAddress ( const EmailSender emailSender)
friend

Associated function for returing the user's e-mail address.

Parameters
emailSender- the instance of the EmailSender class
Returns
the receiver's e-mail address

Referenced by EmailSender().

Member Data Documentation

◆ client

EthernetClient EmailSender::client
private

EthernetClient used to connect to the smt2go server.

Definition at line 62 of file EmailSender.h.

Referenced by efail(), eRcv(), and sendEmail().

◆ enabled

std::map<Type, bool> EmailSender::enabled
private

map holding info about each time of e-mail - whether it's enabled or not

Definition at line 60 of file EmailSender.h.

Referenced by EmailSender(), enableNotification(), getFormatOfSettingsToSave(), and sendEmail().

◆ htmlData

std::map<int, String (*)(const EmailSender& leaksController)> EmailSender::htmlData
private

A map of different values (keys) and their associated functions which returns the appropriate values.

Definition at line 139 of file EmailSender.h.

Referenced by EmailSender().

◆ instance

EmailSender * EmailSender::instance = NULL
staticprivate

the instance of EmailSender

Definition at line 61 of file EmailSender.h.

Referenced by getInstance().

◆ mac

byte EmailSender::mac[6] = { 0x00, 0xAA, 0xBB, 0xCC, 0xDE, 0x02 }
private

mac address of the ethernet shield

Definition at line 64 of file EmailSender.h.

Referenced by setEthernet().

◆ receiverEmailAddress

String EmailSender::receiverEmailAddress = "jakub.sil@seznam.cz"
private

the default user's email address

Definition at line 65 of file EmailSender.h.

Referenced by getFormatOfSettingsToSave(), sendEmail(), and setReceiverEmailAddress().


The documentation for this class was generated from the following files:
EmailSender::CHANGED_SETTINGS
@ CHANGED_SETTINGS
when the user changes settings
Definition: EmailSender.h:51
EmailSender::instance
static EmailSender * instance
the instance of EmailSender
Definition: EmailSender.h:61
arduinoIP
#define arduinoIP
Definition: EmailSender.h:20
EmailSender::HTML_Notification_APPLIED_NEW_SETTING
friend String HTML_Notification_APPLIED_NEW_SETTING(const EmailSender &emailSender)
Associated function for returing the state of the 'applied settings' notification.
EmailSender::BYPASS
@ BYPASS
when a bypass changes
Definition: EmailSender.h:53
EmailSender::HTML_Notification_BYPASS
friend String HTML_Notification_BYPASS(const EmailSender &emailSender)
Associated function for returing the state of the 'bypass state' notification.
SS_SD_CARD
#define SS_SD_CARD
SD card pin (arduino documentation)
Definition: Setup.h:30
EmailSender::receiverEmailAddress
String receiverEmailAddress
the default user's email address
Definition: EmailSender.h:65
EmailSender::enabled
std::map< Type, bool > enabled
map holding info about each time of e-mail - whether it's enabled or not
Definition: EmailSender.h:60
EmailSender::COUNT
@ COUNT
total number of different kinds of e-mails
Definition: EmailSender.h:55
EmailSender::BOOTING
@ BOOTING
when the system boots up
Definition: EmailSender.h:45
emailAddress
#define emailAddress
Definition: EmailSender.h:25
auth64Pass
#define auth64Pass
Definition: EmailSender.h:27
EmailSender::HTML_Notification_VALVE_STATE
friend String HTML_Notification_VALVE_STATE(const EmailSender &emailSender)
Associated function for returing the state of the 'valve state' notification.
EmailSender::HTML_Notification_BOOTING
friend String HTML_Notification_BOOTING(const EmailSender &emailSender)
Associated function for returing the state of the 'bootup' notification.
EmailSender::LEAK_DETECTED
@ LEAK_DETECTED
when a leak has been detected
Definition: EmailSender.h:47
EmailSender::efail
void efail()
Closes the ethernet client after the connection has failed.
Definition: EmailSender.cpp:223
EmailSender::client
EthernetClient client
EthernetClient used to connect to the smt2go server.
Definition: EmailSender.h:62
auth64Login
#define auth64Login
Definition: EmailSender.h:26
EmailSender::mac
byte mac[6]
mac address of the ethernet shield
Definition: EmailSender.h:64
EmailSender::HTML_ReceiverEmailAddress
friend String HTML_ReceiverEmailAddress(const EmailSender &emailSender)
Associated function for returing the user's e-mail address.
EmailSender::sendEmail
byte sendEmail(String subject, String data)
Sends an e-mail off to the smtp2go server.
Definition: EmailSender.cpp:93
SS_ETHERNET
#define SS_ETHERNET
etherent pin (arduino documentation)
Definition: Setup.h:31
EmailSender::HTML_Notification_CHANGED_SETTINGS
friend String HTML_Notification_CHANGED_SETTINGS(const EmailSender &emailSender)
Associated function for returing the state of the 'changed settings' notification.
EmailSender::VALVE_STATE
@ VALVE_STATE
when the state of the valve has changed
Definition: EmailSender.h:48
EmailSender::RESET
@ RESET
when the device resets
Definition: EmailSender.h:49
EmailSender::APPLIED_NEW_SETTING
@ APPLIED_NEW_SETTING
when the new settings are applied
Definition: EmailSender.h:52
EmailSender::eRcv
byte eRcv()
Reads data using the ethernet client comming from the smtp2go server.
Definition: EmailSender.cpp:192
EmailSender::HTML_Notification_ALARM
friend String HTML_Notification_ALARM(const EmailSender &emailSender)
Associated function for returing the state of the 'home alarm state' notification.
SMTPServerAddress
#define SMTPServerAddress
Definition: EmailSender.h:22
EmailSender::HTML_Notification_DAILY_OVERVIEW
friend String HTML_Notification_DAILY_OVERVIEW(const EmailSender &emailSender)
Associated function for returing the state of the 'daily overview' notification.
EmailSender::EmailSender
EmailSender()
Constructor of the class.
Definition: EmailSender.cpp:47
EmailSender::DAILY_OVERVIEW
@ DAILY_OVERVIEW
daily overview about the system
Definition: EmailSender.h:46
EmailSender::HTML_Notification_LEAK_DETECTED
friend String HTML_Notification_LEAK_DETECTED(const EmailSender &emailSender)
Associated function for returing the state of the 'leak detected' notification.
EmailSender::setEthernet
int setEthernet()
Initializes the ethernet shield.
Definition: EmailSender.cpp:18
EmailSender::HTML_Notification_RESET
friend String HTML_Notification_RESET(const EmailSender &emailSender)
Associated function for returing the state of the 'system reset' notification.
EmailSender::ALARM
@ ALARM
when the state of the home alarm changes
Definition: EmailSender.h:50
SMTPServerPort
#define SMTPServerPort
Definition: EmailSender.h:23
EmailSender::htmlData
std::map< int, String(*)(const EmailSender &leaksController)> htmlData
A map of different values (keys) and their associated functions which returns the appropriate values.
Definition: EmailSender.h:139