Pro Feature
How to Send Contact Form 7 Notifications to Chatwork
Learn how to automatically send Contact Form 7 (CF7) form submissions as notifications to a Chatwork group chat. This guide covers a no-code method using the settings screen only, plus a manual implementation using a Chatwork API token, along with common pitfalls.
If you handle inquiries through Chatwork, the most reliable approach is to automatically notify a Chatwork group chat whenever a Contact Form 7 (CF7) submission comes in. Even if someone misses an email, the whole team can still notice the incoming inquiry. This article covers both a no-code method that’s completed entirely through the settings screen, and a manual implementation where you write the code yourself.
Why Chatwork notifications matter
At many Japan-based production and outsourcing companies, day-to-day communication happens primarily through Chatwork. If inquiries only arrive by email, they can get buried in a staff member’s inbox and cause delays. Routing them into Chatwork lets you assign “who handles this” directly within the project room, which speeds up response times.
Method 1: Complete everything through the settings screen (no code, recommended)
You can implement Chatwork notifications entirely through WordPress admin settings, without touching functions.php at all. With Frontierline Forms’ notification integration feature, you can finish in the following four steps. All you need is an API token and a room ID — no code to maintain, and no dependency on your theme.
Steps
- Prepare an API token and room ID: Issue a token from your account name in the top right of Chatwork → “Service Connections” → “API Token.” The room ID is the number at the end of the destination group chat’s URL (
https://www.chatwork.com/#!rid123456789). - Enter the token and room ID: Select Chatwork in the plugin’s notification settings, then enter the API token and destination room ID.
- Specify the notification content: Choose which form fields to insert into the message body directly on the settings screen, without writing any code. Chatwork notation is also supported.
- Send a test submission: Submit the form and confirm that it arrives in the room with the inserted content displayed correctly.
The token is stored securely in the database, so your notification settings won’t break even if you edit the form. You can also set up conditional branching from the settings screen to route different inquiry types to different rooms. This holds up cleanly even across multiple forms and multiple sites.
Method 2: Manual implementation with the Chatwork API (for advanced users)
If you want to write the code yourself, you can implement this using the Chatwork API and CF7’s wpcf7_mail_sent hook.
Prepare an API token and room ID
As in step 1 of Method 1, issue a token from Chatwork’s “Service Connections” → “API Token,” and get the room ID from the number at the end of the destination room’s URL.
Add a hook to functions.php
add_action('wpcf7_mail_sent', function ($form) {
$submission = WPCF7_Submission::get_instance();
$data = $submission ? $submission->get_posted_data() : [];
$body = "[info][title]New Inquiry[/title]"
. "Name: " . ($data['your-name'] ?? '') . "\n"
. "Email: " . ($data['your-email'] ?? '') . "\n"
. "Message: " . ($data['your-message'] ?? '') . "[/info]";
$room_id = '123456789';
wp_remote_post("https://api.chatwork.com/v2/rooms/{$room_id}/messages", [
'headers' => ['X-ChatWorkToken' => 'YOUR_API_TOKEN'],
'body' => ['body' => $body],
]);
});
Using Chatwork notation like [info][title] makes the notification easier to read inside a boxed frame.
Pitfalls of manual implementation
- The API token ends up hardcoded in your code: Writing the token directly into
functions.phprisks exposure through theme files. - Branching logic grows as forms and rooms multiply: If you split rooms by inquiry type, the branching code based on
$form->id()or input values tends to balloon. - Maintenance is tied to the theme: The code can be lost during theme changes or handovers, and this only gets worse the more sites you roll it out to.
Manual implementation can work fine for a single site, but once you factor in securely storing the token and rolling this out across multiple projects, Method 1 — completed entirely through settings — is the more realistic choice.
How is this different from Slack notifications?
Both Chatwork and Slack can deliver notifications via webhook/API. Chatwork tends to suit projects with a lot of Japan-based work and external collaborators, while Slack fits development and internal teams better. Frontierline Forms supports both, so you can choose per project. For the Slack version of this guide, see How to Send Contact Form 7 Notifications to Slack.
Summary
Since CF7 doesn’t have built-in Chatwork integration, you need either a notification-enabled plugin or a manual API-based implementation. If you’re running multiple projects through Chatwork, the settings-only method is faster and keeps token management secure. Method 1 is the best place to start.
If you’d like Chatwork notifications alongside Slack and Google Sheets integration, submission log storage, and CSV export — all set up through settings alone — consider adopting Frontierline Forms.
Frontierline Forms
This setup takes just a checkbox in the admin.
Add alerts, submission logging, CSV export and multi-step forms without writing code — all from the settings screen. The 5-site / unlimited license lets agencies cover form maintenance across many client projects at once. Your license key is issued instantly on payment.