fix(automations): Welcome Message template uses first_inbound_message

The template seeded trigger_type as new_contact_created, which only
fires when the webhook auto-creates a contact row. A user who added
or imported the contact manually before the contact first messaged
would not hit the welcome flow — that's almost certainly not what the
user setting up "Welcome Message" wants.

first_inbound_message (added in PR #33) is the superset: fires the
first time any contact — auto-created or pre-existing — sends us a
customer message. Correct semantic for a welcome/greeting template.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Arnas Donauskas 2026-04-17 21:42:20 +03:00
parent 59d0ea6e17
commit a3d59d8ea3
No known key found for this signature in database

View File

@ -33,7 +33,12 @@ export const AUTOMATION_TEMPLATES: Record<TemplateSlug, AutomationTemplateDefini
slug: 'welcome_message', slug: 'welcome_message',
name: 'Welcome Message', name: 'Welcome Message',
description: 'Auto-reply to first-time contacts with a greeting.', description: 'Auto-reply to first-time contacts with a greeting.',
trigger_type: 'new_contact_created', // first_inbound_message (added in PR #33) catches both brand-new
// contacts AND manually-added/imported contacts on their first-ever
// reply, which is what a user setting up a "welcome" automation
// almost always wants. new_contact_created would miss the
// manually-imported case.
trigger_type: 'first_inbound_message',
trigger_config: {}, trigger_config: {},
steps: [ steps: [
{ {