Notification start

This commit is contained in:
CHIEFSOFT\ameye
2023-12-07 11:56:57 -05:00
parent f13f299059
commit b24526669e
4 changed files with 32 additions and 12 deletions
@@ -17,12 +17,12 @@ img {height: auto;}
.h1, .h2, .bodycopy {color: #153643; font-family: sans-serif;}
.h1 {font-size: 33px; line-height: 38px; font-weight: bold;}
.bodycopy {font-size: 14px; line-height: 20px;}
.button {text-align: center; font-size: 16px; font-family: sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
.button {text-align: center; font-size: 16px; font-family: sans-serif; padding: 0 30px 0 30px;}
.button a {color: #ffffff; text-decoration: none;}
.footer {padding: 20px 30px 15px 30px; bgcolor:#007bff; background-color:#007bff;}
.footercopy {font-family: sans-serif; font-size: 14px; color: #ffffff;}
.footercopy a {color: #ffffff; text-decoration: underline;}
.expire{ color: red;}
.expire{ color: red; font-weight: bold; padding: 10px 0px 20 0px;}
</style>
</head>
<body bgcolor="#f6f8f1">
@@ -74,7 +74,7 @@ img {height: auto;}
<td class="bodycopy">
An offer was sent to you and waiting for your acceptance at <a href="{{server_name}}">{{site_name}}</a>.
<br>Title : {{title}} <br>
<span class="expire">This will expire after {{expire}}.</span>
<span class="expire">This will expire after {{expire_formated}}.</span>
<br>
</td>
</tr>
+1 -1
View File
@@ -41,7 +41,7 @@ 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 plan_notification(CVars in, CVars &out);
long SignupPendingAlertMailfile(CVars in);
long SignupCompletedAlertMailfile(CVars in);
+11 -1
View File
@@ -15,6 +15,16 @@ extern int mailsend(CVars in, CVars &out);
long getContractMemberClientEmail(long contract_id, CVars &out);
long plan_notification(CVars in, CVars &out){
//wrenchboard=> SELECT id AS member_id, uid AS member_uid, 'alert.svg' AS icon FROM members WHERE username = 'ses66181+1@gmail.com';
// member_id | member_uid | icon
//-----------+--------------------------------------+-----------
// 1 | 3119b744-42ad-4834-bb83-b737588754ca | alert.svg
//(1 row)
}
long alert_email(long mailtype, CVars in, CVars &out) {
logfmt(logINFO, "alert_email()");
CVars x, y, z;
@@ -225,7 +235,7 @@ long cron_email(long mailtype, CVars in, CVars &out) {
break;
case WRB_CRONJOB_PENDOFFER_ALERT:
vars2form(x, form); // need to remove
vars2form(x, form); // need to remove
vars2form(in, form);
form.LetStr("email", in["email"].c_str());
form.Email("REMINDER/offer_pending_reminder.mailfile");
+17 -7
View File
@@ -133,7 +133,6 @@ logfmt(logINFO, "ENTER OfferPending()");
long limit = in["one_limit"].Long();
long mode = REQ_LONG(in, "mode", 0, -1);
char extraQ[1600];
if ( mode == 100 ){
@@ -148,8 +147,8 @@ if ( mode == 300 ){
snprintf(extraQ, sizeof (extraQ), " WHERE jo.expire < now() +'6 hrs' AND jo.expire > now() AND jo.status = 1 AND jo.public_view =0 AND jo.reminder_count > 0 AND jo.reminder_date IS NOT NULL");
}
const PGresult *res = pgsql_query("SELECT jo.id AS offer_id,jo.added,j.title,jo.expire,jo.email, jo.client_id, "
"jo.job_id,jo.reminder_count,jo.reminder_date,jo.email AS firstname "
const PGresult *res = pgsql_query("SELECT jo.id AS offer_id,jo.added,j.title,jo.expire,to_char(jo.expire, 'Dy Mon dd, yyyy HH:MI AM') AS expire_formated, jo.email, jo.client_id, "
"jo.job_id,jo.reminder_count,jo.reminder_date,jo.email AS firstname, jo.email AS rec_username "
"FROM members_jobs_offer jo "
"LEFT JOIN members_jobs j ON j.id = jo.job_id "
" %s LIMIT %lu ",extraQ, limit);
@@ -161,16 +160,27 @@ const PGresult *res = pgsql_query("SELECT jo.id AS offer_id,jo.added,j.title,jo.
CVars rec;
map_to_cvars(f, rec);
cron_email(WRB_CRONJOB_PENDOFFER_ALERT, rec, out); // send the cron email
pgsql_exec("UPDATE members_jobs_offer SET reminder_count=reminder_count+1, reminder_date=now() "\
"WHERE id=%lu AND job_id=%lu ", rec["offer_id"].Long(),rec["job_id"].Long());
cron_email(WRB_CRONJOB_PENDOFFER_ALERT, rec, out); // send the cron email
pgsql_exec("UPDATE members_jobs_offer SET reminder_count=reminder_count+1, reminder_date=now() "\
"WHERE id=%lu AND job_id=%lu ", rec["offer_id"].Long(),rec["job_id"].Long());
CVars xy;
if ( load_db_record(xy, "SELECT id AS member_id, uid AS member_uid, 'alert.svg' AS icon "
" FROM members WHERE LOWER(username) = LOWER('%s') ",rec["rec_username"].c_str()) > 0 ){
plan_notification(xy, out);
}
}
}
logfmt(logINFO, "/OfferPending()");
return 0;
}
long InterestPending(CVars in, CVars &out) {