family sugggest tasks
This commit is contained in:
@@ -0,0 +1,220 @@
|
||||
Subject: {{subject}}
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>{{subject}}</title>
|
||||
<style type="text/css">
|
||||
body {margin: 0; padding: 0; min-width: 100%!important;}
|
||||
img {height: auto;}
|
||||
hr{
|
||||
height: 1px;
|
||||
background-color: #f1fcff;
|
||||
border: none;
|
||||
}
|
||||
.content {width: 100%; max-width: 600px;}
|
||||
.header {padding: 10px 10px 10px 10px;}
|
||||
.innerpadding {padding: 10px 10px 10px 10px;}
|
||||
.cent{ text-align:center; }
|
||||
.borderbottom {border-bottom: 1px solid #f2eeed;}
|
||||
.ls1{ border-color: aliceblue; color: aliceblue;}
|
||||
.subhead {font-size: 12px; color: #ffffff; font-family: Circular, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif; letter-spacing: 3px;}
|
||||
.h1, .h2, .bodycopy {color: #153643; font-family: Circular, Helvetica Neue, Helvetica, Roboto, Arial, 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: Circular, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif; font-weight: bold; padding: 0 30px 0 30px;}
|
||||
.button a {color: #ffffff; text-decoration: none;}
|
||||
.footer {padding: 20px 30px 15px 30px; bgcolor:#252f3e; background-color:#252f3e;}
|
||||
.footercopy { font-family: Circular, Helvetica Neue, Helvetica, Roboto, Arial, sans-serif; font-size: 14px; font-weight:bolder; color: #ffffff;}
|
||||
.footercopy a {color: #ffffff; text-decoration: underline;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body yahoo bgcolor="#f6f8f1">
|
||||
<table width="100%" bgcolor="#f6f8f1" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="600" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table bgcolor="#ffffff" class="content" align="center" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td bgcolor="#c7d8a7" class="header">
|
||||
<table width="70" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="70" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="{{server_name}}/assets/images/wrenchboard-icon.gif" width="70" height="70" border="0" alt="WrenchBoard" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="425" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col425" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 425px;">
|
||||
<tr>
|
||||
<td height="50">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td class="h1" style="padding: 5px 0 0 0;">
|
||||
{{site_name}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="subhead" style="padding: 0 0 0 3px;">
|
||||
{{site_trade_name}}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="h3">
|
||||
<b>Message from {{firstname}}</b>,
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="bodycopy">
|
||||
The task at <a href="{{server_name}}/">{{site_name}}</a> shown below is fast approaching deadline.
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<table width="115" align="left" border="0" cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<td height="115" style="padding: 0 20px 20px 0;">
|
||||
<img class="fix" src="{{server_name}}/assets/images/article1.png" width="115" height="115" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
<table width="380" align="left" cellpadding="0" cellspacing="0" border="0">
|
||||
<tr>
|
||||
<td>
|
||||
<![endif]-->
|
||||
<table class="col380" align="left" border="0" cellpadding="0" cellspacing="0" style="width: 100%; max-width: 380px;">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="1" cellpadding="0" class="bodycopy" style="font-size: 14px; font-family: sans-serif; border: 1px solid #f2eeed; background-color:#e6f9ff;">
|
||||
<tr>
|
||||
<td style="width:100px;">
|
||||
<b>Title: </b>
|
||||
|
||||
{{title}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>Job ID: </b>
|
||||
{{contract}}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
This task will be due very soon. After the due date, the task will be past due, and only the owner can extend it is for a short time before the task is closed permanently.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<b>Delivery Date: </b>
|
||||
|
||||
{{delivery_date}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><h4>Please <a href ="{{server_name}}/eoffer?offerID={{offer_code}}">login</a> into your account to manage this task.</h4>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding borderbottom">
|
||||
<img class="fix" src="{{server_name}}/assets/images/wrenchboard_email_banner.jpg" width="100%" border="0" alt="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
Please contact us at https://www.wrenchboard.com/contact if you have any question about this email.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="innerpadding bodycopy">
|
||||
{{site_name}} Team
|
||||
<br>
|
||||
{{server_name}}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="footer">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td align="center" class="footercopy">
|
||||
® {{site_name}} {{YYYY}}<br/>
|
||||
You received this email because you subscribe to {{site_name}}. If you get this email in error, please <a href="{{main_site_url}}contact" class="unsubscribe"><font color="#ffffff">contact</font></a> us.
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" style="padding: 20px 0 0 0;">
|
||||
<table border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="https://www.facebook.com/wrenchboard/">
|
||||
<img src="{{server_name}}/assets/images/brands/facebook.png" width="37" height="37" alt="Facebook" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
<td width="37" style="text-align: center; padding: 0 10px 0 10px;">
|
||||
<a href="http://www.twitter.com/">
|
||||
<img src="{{server_name}}/assets/images/brands/twitter.png" width="37" height="37" alt="Twitter" border="0" />
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!--[if (gte mso 9)|(IE)]>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<![endif]-->
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -39,6 +39,7 @@ long alert_email(long mailtype, CVars in, CVars &out) ;
|
||||
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 SignupPendingAlertMailfile(CVars in);
|
||||
long SignupCompletedAlertMailfile(CVars in);
|
||||
|
||||
@@ -282,6 +282,48 @@ wrenchboard=> SELECT substring(ca.code,0,4)||'XXXXXXXX' as code, ca.amount,m.ema
|
||||
return 0;
|
||||
}
|
||||
|
||||
long family_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_FAMILY_SGGESTTASKS:
|
||||
REQ_LONG(in, "suggest_id", 1, -1);
|
||||
if (load_db_record(x, "SELECT s.*,m.email AS parent_email FROM members_family_suggesttask s "
|
||||
" LEFT JOIN members_family f ON f.family_member_id = s.member_id "
|
||||
" LEFT JOIN members m ON m.id=f.member_id WHERE s.id = %lu", in["suggest_id"].Long())) {
|
||||
vars2form(x, form);
|
||||
form.LetStr("email", x["parent_email"].c_str());
|
||||
form.Email("FAMILY/family_suggest_task.mailfile");
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
} catch (bad_parameter) {
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
long account_email(long mailtype, CVars in, CVars &out) {
|
||||
|
||||
@@ -214,7 +214,7 @@ long WrenchSuggestTaskStatus(CVars in, CVars &out){
|
||||
long member_id = REQ_LONG(in, "member_id", 1, -1);
|
||||
REQ_STRING(in, "uid", 3, 150, "(.*)");
|
||||
REQ_STRING(in, "suggest_uid", 3, 150, "(.*)");
|
||||
REQ_STRING(in, "suggest_action", 3, 25, "(.*)");
|
||||
long suggest_action = REQ_LONG(in, "suggest_action", 1, -1);
|
||||
|
||||
out["suggested_task_id"] ="0";// we will set if all okay
|
||||
const PGresult *res = pgsql_query("SELECT m.*,mf.uid AS family_uid FROM members m "
|
||||
@@ -231,11 +231,25 @@ long WrenchSuggestTaskStatus(CVars in, CVars &out){
|
||||
// NOW LET US FIND THIS TASK
|
||||
logfmt(logINFO, "ERROR CALL long WrenchSuggestTaskStatus- NOW LET US FIND THIS TASK");
|
||||
|
||||
const PGresult *res0 = pgsql_query("SELECT id AS suggest_id,* FROM members_family_suggesttask "
|
||||
" WHERE member_id = %lu AND uid='%s' AND status IN (1,2)", member_id, in["suggest_uid"].c_str());
|
||||
if (res0 != NULL && pgsql_num_rows(res0) > 0) {
|
||||
map<const char*, const char*>f = pgsql_fetch_assoc(res, 0);
|
||||
CVars rec2;
|
||||
map_to_cvars(f, rec2);
|
||||
|
||||
if (suggest_action == 555 ){
|
||||
pgsql_exec("UPDATE members_family_suggesttask SET status=0,updated=now() "
|
||||
" WHERE id=%lu AND uid='%s'", rec2["suggest_id"].Long(),in["suggest_uid"].c_str() );
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
if (suggest_action == 222 ){
|
||||
pgsql_exec("UPDATE members_family_suggesttask SET remind=now(),updated=now() "
|
||||
" WHERE id=%lu AND uid='%s'", rec2["suggest_id"].Long(),in["suggest_uid"].c_str() );
|
||||
family_email(WRENCHBOARD_FAMILY_SGGESTTASKS, rec2, rec2); //
|
||||
}
|
||||
}
|
||||
] }
|
||||
}
|
||||
} catch (bad_parameter) {
|
||||
logfmt(logINFO, "ERROR CALL long WrenchSuggestTaskStatus");
|
||||
@@ -282,6 +296,10 @@ long WrenchSuggestTasks(CVars in, CVars &out){
|
||||
xx["banner"].set_valid(true);
|
||||
|
||||
out["suggested_task_id"] = insert_db_record(DBS_VALID, "members_family_suggesttask", "members_family_suggesttask_id_seq", xx);
|
||||
if(out["suggested_task_id"].Long() > 0 ){
|
||||
load_db_record( out, "SELECT id AS suggest_id,* FROM members_family_suggesttask WHERE id = %lu ", out["suggested_task_id"].Long());
|
||||
family_email(WRENCHBOARD_FAMILY_SGGESTTASKS, out, out); //
|
||||
}
|
||||
ret = PHP_API_OK;
|
||||
out["status"] = "OK";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user