This commit is contained in:
2022-04-09 13:38:05 -04:00
parent 55c06162ef
commit 5f5abd0b3e
+14 -3
View File
@@ -222,6 +222,9 @@ long cron_email(long mailtype, CVars in, CVars &out) {
}
return 0;
}
long account_email(long mailtype, CVars in, CVars &out) {
//REQ_LONG( in, "member_id", 1, -1 );
@@ -231,12 +234,13 @@ long account_email(long mailtype, CVars in, CVars &out) {
CGIList * inv_list = new CGIList(&form, "inv_items");
char listing_items[1024];
const PGresult *res;
bool exclude_email = true;
char * server_name = getenv("SERVER_NAME");
form.LetStr("server_name", "https://dashboard.wrenchboard.com");
form.LetStr("site_name", "WrenchBoard");
form.LetStr("site_trade_name", "Connecting Opportunities");
try {
switch (mailtype) {
@@ -272,7 +276,14 @@ long account_email(long mailtype, CVars in, CVars &out) {
case ACCOUNT_LOGIN_ALERT:
REQ_LONG(in, "member_id", 1, -1);
if (load_db_record(x, "SELECT *,email as email2,to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2 FROM members WHERE id = %lu ", in["member_id"].Long())) {
// testing exclusion first
res = pgsql_query("SELECT * FROM members_settings WHERE member_id = %lu AND pref_id='S0001' AND status=100", in["member_id"].Long());
if (res != NULL && pgsql_num_rows(res) > 0) {
exclude_email = false;
}
if (!exclude_email && load_db_record(x, "SELECT *,email as email2,to_char(last_login, 'Day Mon dd, yyyy HH:MI AM') AS last_login2 FROM members WHERE id = %lu ", in["member_id"].Long())) {
in["server_name"] = "https://dashboard.wrenchboard.com";
@@ -303,7 +314,7 @@ long account_email(long mailtype, CVars in, CVars &out) {
CVars rec;
map_to_cvars(f, rec);
sprintf(listing_items, "<TR><td style='background-color:#%s'><a href='%s/plb/viewjob/%s'>%s</a> - %s<br><b>Duration:</b>%s Day(s)</td></TR>", in["color"].c_str(), in["server_name"].c_str(), rec["offer_code"].c_str(), rec["title"].c_str(), rec["description"].c_str(), rec["timeline_days"].c_str());
sprintf(listing_items, "<TR><td style='background-color:#%s; font-size:12px;'><a href='%s/plb/viewjob/%s'>%s</a> - %s<br><b>Duration:</b>%s Day(s)</td></TR>", in["color"].c_str(), in["server_name"].c_str(), rec["offer_code"].c_str(), rec["title"].c_str(), rec["description"].c_str(), rec["timeline_days"].c_str());
inv_list->LetStr("pin", listing_items);
inv_list->CloseElement();
//<hr size=1 color=#FF0000>