fix
This commit is contained in:
@@ -223,6 +223,49 @@ long cron_email(long mailtype, CVars in, CVars &out) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
long coupon_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");
|
||||
form.LetStr("site_name", "WrenchBoard");
|
||||
form.LetStr("site_trade_name", "Connecting Opportunities");
|
||||
|
||||
try {
|
||||
|
||||
switch (mailtype) {
|
||||
/*
|
||||
|
||||
wrenchboard=> SELECT substring(ca.code,0,4)||'XXXXXXXX' as code, ca.amount,m.email,m.firstname FROM coupons_allocation ca LEFT JOIN members m ON m.id=ca.member_id;
|
||||
code | amount | email | firstname
|
||||
-------------+--------+----------------------+-----------
|
||||
1M5XXXXXXXX | 0 | ses66181+1@gmail.com | Olusesan
|
||||
*/
|
||||
case WRENCHBOARD_COUPON_ACTIVATE:
|
||||
REQ_LONG(in, "coupon_id", 1, -1);
|
||||
if (load_db_record(x, "SELECT substring(ca.code,0,4)||'XXXXXXXX' as code, ca.amount,m.email,m.firstname FROM coupons_allocation ca LEFT JOIN members m ON m.id=ca.member_id WHERE ca.id = %lu ", in["coupon_id"].Long())) {
|
||||
vars2form(x, form);
|
||||
form.LetStr("email", x["email"].c_str());
|
||||
form.Email("COUPON/member_coupon_allocated.mailfile");
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
} catch (bad_parameter) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
long account_email(long mailtype, CVars in, CVars &out) {
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "pgsql_wrapper.h"
|
||||
#include "stripe_charge.h"
|
||||
#include "account_mngt.h"
|
||||
#include "coupons.h"
|
||||
|
||||
#include "twilo.h"
|
||||
//extern CSQL *sql;
|
||||
@@ -56,6 +57,11 @@ long wrenchboard_api_main(CVars in, CVars &out) {
|
||||
return sitecrons_calls(in, out);
|
||||
}
|
||||
|
||||
if (action >= WRENCHBOARD_COUPON_START && action <= WRENCHBOARD_COUPON_END) {
|
||||
logfmt(logINFO, "coupons_calls");
|
||||
return coupons_calls(in, out);
|
||||
}
|
||||
|
||||
if (action >= WRENCHBOARD_ACCOUNT_START && action <= WRENCHBOARD_ACCOUNT_END) {
|
||||
logfmt(logINFO, "account calls");
|
||||
return account_calls(in, out);
|
||||
|
||||
Reference in New Issue
Block a user