Add n8n test mode toggle and edge function improvements
- Add test/production toggle for n8n webhook URLs in IntegrasiTab - Update create-meet-link function to use database test_mode setting - Add send-email-v2 edge function for Mailketing API integration - Update daily-reminders and send-consultation-reminder to use send-email-v2 - Remove deprecated branding field from BrandingTab - Update domain references from hub.dwindi.com to with.dwindi.com - Add environment variables for Coolify deployment - Add comprehensive edge function test script - Update payment flow redirect to order detail page 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select';
|
||||
import { Alert, AlertDescription } from '@/components/ui/alert';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
import { toast } from '@/hooks/use-toast';
|
||||
import { Puzzle, Webhook, MessageSquare, Calendar, Mail, Link as LinkIcon, Key, Send, AlertTriangle } from 'lucide-react';
|
||||
|
||||
@@ -19,6 +20,7 @@ interface IntegrationSettings {
|
||||
integration_email_api_base_url: string;
|
||||
integration_privacy_url: string;
|
||||
integration_terms_url: string;
|
||||
integration_n8n_test_mode: boolean;
|
||||
// Mailketing specific settings
|
||||
provider: 'mailketing' | 'smtp';
|
||||
api_token: string;
|
||||
@@ -35,6 +37,7 @@ const emptySettings: IntegrationSettings = {
|
||||
integration_email_api_base_url: '',
|
||||
integration_privacy_url: '/privacy',
|
||||
integration_terms_url: '/terms',
|
||||
integration_n8n_test_mode: false,
|
||||
provider: 'mailketing',
|
||||
api_token: '',
|
||||
from_name: '',
|
||||
@@ -75,6 +78,7 @@ export function IntegrasiTab() {
|
||||
integration_email_api_base_url: platformData.integration_email_api_base_url || '',
|
||||
integration_privacy_url: platformData.integration_privacy_url || '/privacy',
|
||||
integration_terms_url: platformData.integration_terms_url || '/terms',
|
||||
integration_n8n_test_mode: platformData.integration_n8n_test_mode || false,
|
||||
// Email settings from notification_settings
|
||||
provider: emailData?.provider || 'mailketing',
|
||||
api_token: emailData?.api_token || '',
|
||||
@@ -99,6 +103,7 @@ export function IntegrasiTab() {
|
||||
integration_email_api_base_url: settings.integration_email_api_base_url,
|
||||
integration_privacy_url: settings.integration_privacy_url,
|
||||
integration_terms_url: settings.integration_terms_url,
|
||||
integration_n8n_test_mode: settings.integration_n8n_test_mode,
|
||||
};
|
||||
|
||||
if (settings.id) {
|
||||
@@ -215,6 +220,28 @@ export function IntegrasiTab() {
|
||||
Digunakan sebagai target default untuk webhook lanjutan. webhook_url per template tetap harus URL lengkap.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center justify-between p-4 border rounded-lg space-y-0">
|
||||
<div className="space-y-0.5">
|
||||
<Label>Mode Test n8n</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Aktifkan untuk menggunakan webhook path /webhook-test/ instead of /webhook/
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
checked={settings.integration_n8n_test_mode}
|
||||
onCheckedChange={(checked) => setSettings({ ...settings, integration_n8n_test_mode: checked })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
{settings.integration_n8n_test_mode && (
|
||||
<Alert>
|
||||
<AlertTriangle className="w-4 h-4" />
|
||||
<AlertDescription>
|
||||
Mode test aktif: Webhook akan menggunakan path <code>/webhook-test/</code>
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user