promotion files

This commit is contained in:
CHIEFSOFT\ameye
2023-09-23 16:24:56 -04:00
parent 91f8d264e5
commit 3a1d397a74
6 changed files with 65 additions and 1 deletions
View File
+1
View File
@@ -40,6 +40,7 @@ long SendmarketMessage(CVars in, CVars &out);
long cron_email(long mailtype, CVars in, CVars &out);
long coupon_email(long mailtype, CVars in, CVars &out);
long family_email(long mailtype, CVars in, CVars &out);
long market_email(long mailtype, CVars in, CVars &out);
long SignupPendingAlertMailfile(CVars in);
long SignupCompletedAlertMailfile(CVars in);
@@ -155,6 +155,7 @@ enum { PARTNER_STRIPE };
#define WRENCHBOARD_BKO_UPDATEUSER 10020
#define WRENCHBOARD_BKO_RESEND_OFFER 10025
#define WRENCHBOARD_BKO_MARKETING_MSG 10026
#define WRENCHBOARD_BKO_SEND_PUSH 10035
+21 -1
View File
@@ -20,6 +20,7 @@
long BkoCommonSessionCheck(long backoffice_id,long shop,long acc, const char *sessionid, int create );
long BkoResendOffer(CVars in, CVars &out);
long BkoSendPush(CVars in, CVars &out);
long BkoResendMarketing(CVars in, CVars &out);
struct MemoryStruct {
char *memory;
@@ -59,7 +60,11 @@ long bko_calls(CVars in, CVars &out)
case WRENCHBOARD_BKO_RESEND_OFFER:
return BkoResendOffer( in, out);
break;
case WRENCHBOARD_BKO_MARKETING_MSG:
return BkoResendMarketing( in, out );
break;
case WRENCHBOARD_BKO_SEND_PUSH:
return BkoSendPush( in, out);
break;
@@ -68,6 +73,21 @@ long bko_calls(CVars in, CVars &out)
return 0;
}
long BkoResendMarketing(CVars in, CVars &out)
{
logfmt( logINFO, "BkoResendMarketing()" );
REQ_STRING (in, "uid", 5, 149, "(.*)");
CVars x;
if ( load_db_record( x, "SELECT * FROM marketing_list WHERE uid='%s'", in["uid"].c_str() )){
market_email(WRENCHBOARD_BKO_MARKETING_MSG, x, out);
}
logfmt( logINFO, "/BkoResendMarketing()" );
return 0;
}
long BkoResendOffer(CVars in, CVars &out)
{
logfmt( logINFO, "BkoResendOffer()" );
+42
View File
@@ -282,6 +282,48 @@ wrenchboard=> SELECT substring(ca.code,0,4)||'XXXXXXXX' as code, ca.amount,m.ema
return 0;
}
long market_email(long mailtype, CVars in, CVars &out) {
//REQ_LONG( in, "member_id", 1, -1 );
CVars x;
C_CGI_Form form("", "");
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");
in["server_name"] = CfgReadChar("system.server_name");
form.LetStr("server_name", in["server_name"].c_str());
form.LetStr("site_name", "WrenchBoard");
form.LetStr("site_trade_name", "Connecting Opportunities");
try {
switch (mailtype) {
case WRENCHBOARD_BKO_MARKETING_MSG:
REQ_LONG(in, "uid", 1, -1);
if (load_db_record(x, "SELECT email AS market_email, * FROM marketing_list WHERE uid='%s'", in["uid"].c_str())) {
vars2form(x, form);
form.LetStr("subject", "makrting subject here ");
form.LetStr("email", x["market_email"].c_str());
form.Email("MARKET/promotion1.mailfile");
}
break;
}
} catch (bad_parameter) {
}
return 0;
}
long family_email(long mailtype, CVars in, CVars &out) {
//REQ_LONG( in, "member_id", 1, -1 );