feat(blog): add detailed update on Influence and Map app developments since August
A bunch of udpates to the listmonk sync to add influence to it
This commit is contained in:
@@ -1081,6 +1081,12 @@ create_campaigns_table() {
|
||||
"uidt": "Checkbox",
|
||||
"cdf": "false"
|
||||
},
|
||||
{
|
||||
"column_name": "allow_custom_recipients",
|
||||
"title": "Allow Custom Recipients",
|
||||
"uidt": "Checkbox",
|
||||
"cdf": "false"
|
||||
},
|
||||
{
|
||||
"column_name": "show_response_wall",
|
||||
"title": "Show Response Wall Button",
|
||||
@@ -1645,6 +1651,76 @@ create_users_table() {
|
||||
create_table "$base_id" "influence_users" "$table_data" "User authentication and management"
|
||||
}
|
||||
|
||||
# Function to create the custom recipients table
|
||||
create_custom_recipients_table() {
|
||||
local base_id=$1
|
||||
|
||||
local table_data='{
|
||||
"table_name": "influence_custom_recipients",
|
||||
"title": "Custom Recipients",
|
||||
"columns": [
|
||||
{
|
||||
"column_name": "id",
|
||||
"title": "ID",
|
||||
"uidt": "ID",
|
||||
"pk": true,
|
||||
"ai": true,
|
||||
"rqd": true
|
||||
},
|
||||
{
|
||||
"column_name": "campaign_id",
|
||||
"title": "Campaign ID",
|
||||
"uidt": "Number",
|
||||
"rqd": true
|
||||
},
|
||||
{
|
||||
"column_name": "campaign_slug",
|
||||
"title": "Campaign Slug",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": true
|
||||
},
|
||||
{
|
||||
"column_name": "recipient_name",
|
||||
"title": "Recipient Name",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": true
|
||||
},
|
||||
{
|
||||
"column_name": "recipient_email",
|
||||
"title": "Recipient Email",
|
||||
"uidt": "Email",
|
||||
"rqd": true
|
||||
},
|
||||
{
|
||||
"column_name": "recipient_title",
|
||||
"title": "Recipient Title",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "recipient_organization",
|
||||
"title": "Recipient Organization",
|
||||
"uidt": "SingleLineText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "notes",
|
||||
"title": "Notes",
|
||||
"uidt": "LongText",
|
||||
"rqd": false
|
||||
},
|
||||
{
|
||||
"column_name": "is_active",
|
||||
"title": "Is Active",
|
||||
"uidt": "Checkbox",
|
||||
"cdf": "true"
|
||||
}
|
||||
]
|
||||
}'
|
||||
|
||||
create_table "$base_id" "influence_custom_recipients" "$table_data" "Custom email recipients for campaigns"
|
||||
}
|
||||
|
||||
# Function to create the email verifications table
|
||||
create_email_verifications_table() {
|
||||
local base_id=$1
|
||||
@@ -1744,6 +1820,7 @@ update_env_with_table_ids() {
|
||||
local representative_responses_table_id=$9
|
||||
local response_upvotes_table_id=${10}
|
||||
local email_verifications_table_id=${11}
|
||||
local custom_recipients_table_id=${12}
|
||||
|
||||
print_status "Updating .env file with NocoDB project and table IDs..."
|
||||
|
||||
@@ -1782,6 +1859,7 @@ update_env_with_table_ids() {
|
||||
update_env_var "NOCODB_TABLE_REPRESENTATIVE_RESPONSES" "$representative_responses_table_id"
|
||||
update_env_var "NOCODB_TABLE_RESPONSE_UPVOTES" "$response_upvotes_table_id"
|
||||
update_env_var "NOCODB_TABLE_EMAIL_VERIFICATIONS" "$email_verifications_table_id"
|
||||
update_env_var "NOCODB_TABLE_CUSTOM_RECIPIENTS" "$custom_recipients_table_id"
|
||||
|
||||
print_success "Successfully updated .env file with all table IDs"
|
||||
|
||||
@@ -1798,6 +1876,7 @@ update_env_with_table_ids() {
|
||||
print_status "NOCODB_TABLE_CALLS=$call_logs_table_id"
|
||||
print_status "NOCODB_TABLE_REPRESENTATIVE_RESPONSES=$representative_responses_table_id"
|
||||
print_status "NOCODB_TABLE_RESPONSE_UPVOTES=$response_upvotes_table_id"
|
||||
print_status "NOCODB_TABLE_CUSTOM_RECIPIENTS=$custom_recipients_table_id"
|
||||
}
|
||||
|
||||
|
||||
@@ -1926,8 +2005,15 @@ main() {
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create custom recipients table
|
||||
CUSTOM_RECIPIENTS_TABLE_ID=$(create_custom_recipients_table "$BASE_ID")
|
||||
if [[ $? -ne 0 ]]; then
|
||||
print_error "Failed to create custom recipients table"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate all table IDs were created successfully
|
||||
if ! validate_table_ids "$REPRESENTATIVES_TABLE_ID" "$EMAIL_LOGS_TABLE_ID" "$POSTAL_CODES_TABLE_ID" "$CAMPAIGNS_TABLE_ID" "$CAMPAIGN_EMAILS_TABLE_ID" "$USERS_TABLE_ID" "$CALL_LOGS_TABLE_ID" "$REPRESENTATIVE_RESPONSES_TABLE_ID" "$RESPONSE_UPVOTES_TABLE_ID" "$EMAIL_VERIFICATIONS_TABLE_ID"; then
|
||||
if ! validate_table_ids "$REPRESENTATIVES_TABLE_ID" "$EMAIL_LOGS_TABLE_ID" "$POSTAL_CODES_TABLE_ID" "$CAMPAIGNS_TABLE_ID" "$CAMPAIGN_EMAILS_TABLE_ID" "$USERS_TABLE_ID" "$CALL_LOGS_TABLE_ID" "$REPRESENTATIVE_RESPONSES_TABLE_ID" "$RESPONSE_UPVOTES_TABLE_ID" "$EMAIL_VERIFICATIONS_TABLE_ID" "$CUSTOM_RECIPIENTS_TABLE_ID"; then
|
||||
print_error "One or more table IDs are invalid"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1952,6 +2038,7 @@ main() {
|
||||
table_mapping["influence_representative_responses"]="$REPRESENTATIVE_RESPONSES_TABLE_ID"
|
||||
table_mapping["influence_response_upvotes"]="$RESPONSE_UPVOTES_TABLE_ID"
|
||||
table_mapping["influence_email_verifications"]="$EMAIL_VERIFICATIONS_TABLE_ID"
|
||||
table_mapping["influence_custom_recipients"]="$CUSTOM_RECIPIENTS_TABLE_ID"
|
||||
|
||||
# Get source table information
|
||||
local source_tables_response
|
||||
@@ -2029,7 +2116,7 @@ main() {
|
||||
fi
|
||||
|
||||
# Update .env file with table IDs
|
||||
update_env_with_table_ids "$BASE_ID" "$REPRESENTATIVES_TABLE_ID" "$EMAIL_LOGS_TABLE_ID" "$POSTAL_CODES_TABLE_ID" "$CAMPAIGNS_TABLE_ID" "$CAMPAIGN_EMAILS_TABLE_ID" "$USERS_TABLE_ID" "$CALL_LOGS_TABLE_ID" "$REPRESENTATIVE_RESPONSES_TABLE_ID" "$RESPONSE_UPVOTES_TABLE_ID" "$EMAIL_VERIFICATIONS_TABLE_ID"
|
||||
update_env_with_table_ids "$BASE_ID" "$REPRESENTATIVES_TABLE_ID" "$EMAIL_LOGS_TABLE_ID" "$POSTAL_CODES_TABLE_ID" "$CAMPAIGNS_TABLE_ID" "$CAMPAIGN_EMAILS_TABLE_ID" "$USERS_TABLE_ID" "$CALL_LOGS_TABLE_ID" "$REPRESENTATIVE_RESPONSES_TABLE_ID" "$RESPONSE_UPVOTES_TABLE_ID" "$EMAIL_VERIFICATIONS_TABLE_ID" "$CUSTOM_RECIPIENTS_TABLE_ID"
|
||||
|
||||
print_status ""
|
||||
print_status "============================================================"
|
||||
|
||||
Reference in New Issue
Block a user