RFC 28822 compliance changes.
Move Mail Functionality into smtpManager.cpp
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#include "utilities.cpp"
|
||||
#include "regularTaskExecution.cpp"
|
||||
#include "templateConstCollection.cpp"
|
||||
#include "smtpManager.cpp"
|
||||
|
||||
using namespace std;
|
||||
using namespace TemplateConstCollection;
|
||||
@ -26,6 +27,10 @@ int main(int argc, char *argv[]) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
//simple email test, header validation via https://mailheader.org/
|
||||
//SMTPManager::sendEmail(configuration, "mail@mail.de", "testsubject", "<h2> bluetest<h2><br>blue<br>yellow");
|
||||
//return 0;
|
||||
|
||||
// Create app with Middleware
|
||||
crow::App<crow::CookieParser> app;
|
||||
|
||||
@ -239,7 +244,7 @@ int main(int argc, char *argv[]) {
|
||||
templateHTML = TEMPLATE_CUSTOMER_FREELANCER_TEMPLATE_REQUEST_FULFILMENT;
|
||||
pqxx::result resultEmailAddress = Database::executePreparedStatement_SELECT_FREELANCER_EMAIL(databaseConnection, newRequest.freelancerID);
|
||||
if (!resultEmailAddress.empty())
|
||||
Utilities::sendEmail(configuration, resultEmailAddress.at(0).at(0).c_str(), "NEW REQUEST", newRequest.toJSONString());
|
||||
SMTPManager::sendEmail(configuration, resultEmailAddress.at(0).at(0).c_str(), "NEW REQUEST", newRequest.toJSONString());
|
||||
}
|
||||
else {
|
||||
ctx[MUSTACHE_ERROR_UNABLE_TO_CREATE_REQUEST] = true;
|
||||
@ -355,7 +360,7 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
Database::executePreparedStatement_INSERT_FREELANCER_RESET_KEY(databaseConnection, email, passwordResetKey);
|
||||
|
||||
if (Utilities::sendPasswordResetEmail(configuration, email, passwordResetKey) == 0)
|
||||
if (SMTPManager::sendPasswordResetEmail(configuration, email, passwordResetKey) == 1)
|
||||
ctx["passwordresetmailsent"] = true;
|
||||
}
|
||||
ctx["resetemail"] = email;
|
||||
|
Reference in New Issue
Block a user