Refre email as actions

This commit is contained in:
CHIEFSOFT\ameye
2024-11-28 03:30:13 -05:00
parent 393af7d657
commit df9ea92d8c
2 changed files with 155 additions and 83 deletions
+9 -1
View File
@@ -2110,6 +2110,7 @@ long WrenchSendReferLoadLink(CVars in, CVars &out) {
long WrenchSendRefer(CVars in, CVars &out) {
logfmt(logINFO, "long WrenchSendRefer(CVars in, CVars out)");
long ret = PHP_API_BAD_PARAM;
CVars ml;
try {
//out = in;
out["status"] = "";
@@ -2164,7 +2165,14 @@ long WrenchSendRefer(CVars in, CVars &out) {
const PGresult *res4 = pgsql_query("UPDATE members_refer_friend SET sent=now() WHERE id=%lu", refer_id);
in["refer_id"] = refer_id;
in["refer_id"].set_valid(true);
account_email(ACCOUNT_SEND_REFEREMAIL, in, out); // ALERT REFER EMAIL
ml["action"] = ACCOUNT_SEND_REFEREMAIL; ml["action"].set_valid( true );
ml["topic"] = "ACCOUNT_SEND_REFEREMAIL"; ml["topic"].set_valid( true );
ml["refer_id"] = refer_id; ml["refer_id"].set_valid( true );
//ml["interest_id"] = in["interest_id"]; ml["interest_id"].set_valid( true );
submit_cron_email(ml);
// account_email(ACCOUNT_SEND_REFEREMAIL, in, out); // ALERT REFER EMAIL
out["status"] = "Refer message sent";
ret = PHP_API_OK;
}