diff --git a/.build.hash b/.build.hash
index b81397b..97c76bb 100644
--- a/.build.hash
+++ b/.build.hash
@@ -1 +1 @@
-33fb91d4b60b7f14d236f83e44c9db42fa1d440f-372bcf506971f56c4911b429b9f5de5bc37ed008-e9eccd451b778829eb2f2c9752c670b707e1268b
+767a2e51259e707655c80d6449afa93abf982fec-372bcf506971f56c4911b429b9f5de5bc37ed008-e9eccd451b778829eb2f2c9752c670b707e1268b
diff --git a/backend/server1.js b/backend/server1.js
index 9ea454e..efacfdb 100755
--- a/backend/server1.js
+++ b/backend/server1.js
@@ -1024,7 +1024,8 @@ app.post('/api/user-profile', requireAuth, async (req, res) => {
career_priorities,
career_list,
phone_e164,
- sms_opt_in
+ sms_opt_in,
+ sms_reminders_opt_in
} = req.body;
try {
@@ -1069,6 +1070,10 @@ app.post('/api/user-profile', requireAuth, async (req, res) => {
? (sms_opt_in ? 1 : 0)
: (existing?.sms_opt_in ?? 0);
+ const smsRemindersFinal = (typeof sms_reminders_opt_in === 'boolean')
+ ? (sms_reminders_opt_in ? 1 : 0)
+ : (existing?.sms_reminders_opt_in ?? 0);
+
if (existing) {
const updateQuery = `
UPDATE user_profile
@@ -1086,7 +1091,14 @@ app.post('/api/user-profile', requireAuth, async (req, res) => {
career_priorities = ?,
career_list = ?,
phone_e164 = ?,
- sms_opt_in = ?
+ sms_opt_in = ?,
+ sms_reminders_opt_in = ?
+ sms_reminders_opt_in_at =
+ CASE
+ WHEN ? = 1 AND (sms_reminders_opt_in IS NULL OR sms_reminders_opt_in = 0)
+ THEN UTC_TIMESTAMP()
+ ELSE sms_reminders_opt_in_at
+ END
WHERE id = ?
`;
const params = [
@@ -1105,6 +1117,7 @@ app.post('/api/user-profile', requireAuth, async (req, res) => {
finalCareerList,
phoneFinal,
smsOptFinal,
+ smsRemindersFinal,
profileId
];
@@ -1116,17 +1129,17 @@ app.post('/api/user-profile', requireAuth, async (req, res) => {
INSERT INTO user_profile
(id, username, firstname, lastname, email, email_lookup, zipcode, state, area,
career_situation, interest_inventory_answers, riasec_scores,
- career_priorities, career_list, phone_e164, sms_opt_in)
+ career_priorities, career_list, phone_e164, sms_opt_in, sms_reminders_opt_in)
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?,
?, ?, ?,
- ?, ?, ?, ?)
+ ?, ?, ?, ?, ?)
`;
const params = [
profileId,
finalUserName,
firstName,
lastName,
- encEmail, // <-- was emailNorm
+ encEmail,
emailLookupVal,
zipCode,
state,
@@ -1137,7 +1150,8 @@ app.post('/api/user-profile', requireAuth, async (req, res) => {
finalCareerPriorities,
finalCareerList,
phoneFinal,
- smsOptFinal
+ smsOptFinal,
+ smsRemindersFinal
];
diff --git a/backend/server3.js b/backend/server3.js
index afda958..b879e0e 100644
--- a/backend/server3.js
+++ b/backend/server3.js
@@ -19,7 +19,7 @@ import pkg from 'pdfjs-dist';
import pool from './config/mysqlPool.js';
import { v4 as uuid } from 'uuid';
import { decrypt } from './shared/crypto/encryption.js'
-
+import crypto from 'crypto';
import OpenAI from 'openai';
import Fuse from 'fuse.js';
import Stripe from 'stripe';
@@ -690,7 +690,7 @@ const twilioForm = express.urlencoded({ extended: false });
app.post('/api/auth/sms/inbound', twilioForm, async (req, res) => {
const body = String(req.body?.Body || '').trim().toUpperCase();
if (body === 'HELP') {
- const twiml = `
Originating number(s): +1 478-500-3955
+Users opt in inside their account by entering a mobile number, checking a non-prechecked consent box linking to our SMS Terms, Privacy Policy, and @@ -66,8 +68,10 @@
All samples include brand and opt-out/help language; no shortened links or phone numbers in 2FA content.
AptivaAI code: 123456. Expires in 10 minutes. Reply STOP to cancel, HELP for help.
AptivaAI sign-in code: 654321. If you didn’t request this, change your password.
AptivaAI sign-in code: 654321. If you didn't request this, change your password.
AptivaAI password reset code: 112233. Expires in 10 minutes. Reply STOP to cancel.
AptivaAI: SMS for verification & security alerts enabled. Message & Data rates may apply. Reply HELP for help, STOP to cancel. Frequency varies.
Carriers are not liable for delayed or undelivered messages.