Refactor Sendmail

Refactor Sendmail
This commit is contained in:
Theo Arends 2019-09-05 17:19:19 +02:00
parent aaf542bf97
commit ea0fb65845
2 changed files with 5 additions and 7 deletions

View File

@ -96,6 +96,7 @@
#define D_JSON_LOW "Low"
#define D_JSON_MAC "Mac"
#define D_JSON_MASK "Mask"
#define D_JSON_MEMORY_ERROR "Memory error"
#define D_JSON_MINIMAL "minimal"
#define D_JSON_MODEL "Model"
#define D_JSON_MQTT_COUNT "MqttCount"
@ -326,6 +327,7 @@
#define D_CMND_WEBCOLOR "WebColor"
#define D_CMND_WEBSENSOR "WebSensor"
#define D_CMND_EMULATION "Emulation"
#define D_CMND_SENDMAIL "Sendmail"
// Commands xdrv_03_energy.ino
#define D_CMND_POWERLOW "PowerLow"

View File

@ -2608,10 +2608,6 @@ bool JsonWebColor(const char* dataBuf)
return true;
}
#define D_CMND_SENDMAIL "sendmail"
#define D_JSON_MEMORY_ERROR "memory error"
const char kWebSendStatus[] PROGMEM = D_JSON_DONE "|" D_JSON_WRONG_PARAMETERS "|" D_JSON_CONNECT_FAILED "|" D_JSON_HOST_NOT_FOUND "|" D_JSON_MEMORY_ERROR;
const char kWebCommands[] PROGMEM = "|" // No prefix
@ -2660,9 +2656,9 @@ void CmndEmulation(void)
void CmndSendmail(void)
{
if (XdrvMailbox.data_len > 0) {
uint8_t result = SendMail(XdrvMailbox.data);
char stemp1[20];
ResponseCmndChar(GetTextIndexed(stemp1, sizeof(stemp1), result, kWebSendStatus));
uint8_t result = SendMail(XdrvMailbox.data);
char stemp1[20];
ResponseCmndChar(GetTextIndexed(stemp1, sizeof(stemp1), result, kWebSendStatus));
}
}
#endif // USE_SENDMAIL