Tutorials / Slack
Tutorial · no code · 10 minutesSend emails to a Slack channel, with the details picked out
Website enquiries, invoices, alerts: some email is really for a team, not an inbox. This tutorial posts every enquiry sent to enquiries@ to #sales within seconds, with the person's name, company, phone and budget laid out as fields, so whoever is free can pick it up.
You need a GhostParse account with a domain that receives email (or your instant inbox address), and permission to add apps to your Slack workspace.
1. Create an incoming webhook in Slack
An incoming webhook is a URL that posts into one Slack channel. You make it once:
- Go to api.slack.com/apps and choose Create New App → From scratch. Call it GhostParse and pick your workspace.
- Under Features, open Incoming Webhooks and switch it On.
- Choose Add New Webhook to Workspace, pick #sales and choose Allow.
- Copy the webhook URL. It looks like
https://hooks.slack.com/services/T…/B…/….
Treat the URL like a password: anyone who has it can post to that channel. For a second channel, add another webhook to the same app.
2. Add it as a destination
In the dashboard, open Integrations and fill in Add a destination:
- Send to: Slack. Name:
#sales, so you can tell your channels apart. - Incoming webhook URL: the URL from step 1. It's stored encrypted and never shown again.
- Include the message text: untick it if the fields from step 3 are enough. Less of each email then ends up in Slack.
- Send every email here, with Only for addresses like
enquiries@*: only email to that address goes to the channel. Leave the box unticked if you'd rather pick emails with routing rules (step 5).
Choose Add destination, then Send test: a sample email appears in #sales and the destination shows Working.
Or with the API (a key with the Integrations permission):
curl https://ghostparse.com/v1/destinations -H "Authorization: Bearer $EMAIL_PARSER_API_KEY" \
-H "Content-Type: application/json" -d '{
"type": "slack",
"name": "#sales",
"url": "https://hooks.slack.com/services/T…/B…/…",
"include_body": false,
"all_mail": true,
"filter": { "address": "enquiries@*" }
}'
curl -X POST https://ghostparse.com/v1/destinations/dst_…/test -H "Authorization: Bearer $EMAIL_PARSER_API_KEY"
3. Pick out the details
Without a parser, Slack shows the subject, the sender and the message. A parser adds the details your team actually needs as neat fields. Contact forms send email like this:
Name: Priya Shah Company: Northwind Studio Phone: +44 20 7946 0321 Budget: £8,000 Message: We're moving support off a shared Gmail inbox and need a helpdesk for 40 people by January…
Open Parsers → New parser, call it Website enquiries, and add one field per line, each one Text after its label:
| Field | Type | Where to find it |
|---|---|---|
name | Text | Text after Name: |
company | Text | Text after Company: |
phone | Text | Text after Phone: |
budget | Text | Text after Budget: |
message | Text | Text after Message: |
Save it and use Try it on a real enquiry. Then open your domain and choose the parser for enquiries@ under Email addresses. If your forms don't use labels, or every one is different, start from the ready-made Website contact form parser instead: it reads the email with AI and also gives you a one-line summary and the enquiry_type.
4. Watch one arrive
Fill in your own contact form, or email enquiries@ yourself. A second later, #sales gets:
| Part of the message | What's in it |
|---|---|
| Heading | The subject |
| From | The sender's name and address |
| Text | The message, without quoted replies (only with Include the message text) |
| Fields | Your parser's fields, up to ten |
| Footer | The address it was sent to, attachment names and the spam score |
Your webhook (if you have one) still gets the full email as usual: Slack gets a copy. Each delivery is in the Delivery log.
5. Send different emails to different channels
Routing rules decide what goes where by the sender, subject, text, attachments, spam score or any header. For example, add a second destination for #sales-urgent with Send every email here unticked, then on Routing rules:
- If the subject contains
urgentthen also send a copy to #sales-urgent. - If the sender's domain is
yourbank.examplethen also send a copy to #finance.
Use Try your rules on that page to see where an email would go without sending anything. With the API:
curl https://ghostparse.com/v1/rules -H "Authorization: Bearer $EMAIL_PARSER_API_KEY" \
-H "Content-Type: application/json" -d '{
"name": "Urgent enquiries",
"conditions": [{ "field": "subject", "op": "contains", "value": "urgent" }],
"action": "copy",
"targets": ["dst_…"]
}'
If nothing appears
- The destination shows Failing: hover over the badge for Slack's answer.
no_serviceorinvalid_tokenmeans the webhook was removed or the app uninstalled: make a new webhook and paste it into the destination.channel_is_archivedmeans what it says. - It shows Working but nothing new arrives: check the filter matches the address the email was sent to, and that no routing rule drops or reroutes it (Try your rules shows which rule matched).
- The fields are missing: the parser isn't set on that address, or the labels in the email are different. Try it on the parser's page shows what it finds.
Microsoft Teams works the same way: add a Microsoft Teams destination with a Workflows URL instead. The steps.