Email Logging: Emails Not Appearing

Troubleshooting guide for email logging integration. Learn why emails aren't appearing, how to configure email forwarding, webhook setup, API key issues, and email correlation problems.

Published 11/16/2025Updated 11/16/20259 min read

Problem Statement

The Issue

You've set up email logging, but emails aren't appearing in Piraja CRM. This could be:

  • Emails sent with BCC not appearing
  • Webhook not receiving emails
  • API key errors
  • Emails not correlating with contacts
  • Integration not working

Common Scenarios

Scenario 1: BCC Not Working

  • Added forwarding address to BCC
  • Email sent but not appearing in CRM
  • No error messages, just no emails

Scenario 2: Webhook Issues

  • "Missing API key" error
  • "Invalid API key" error
  • Webhook not receiving emails

Scenario 3: Correlation Problems

  • Emails appearing but not linked to contacts
  • "No correlation found" messages
  • Can't assign emails to contacts

Scenario 4: Integration Not Active

  • Integration shows as inactive
  • Can't enable integration
  • Configuration errors

Why BCC Alone Doesn't Work

The Misconception

Many users think that simply adding the forwarding address to BCC will automatically log emails. This is not how it works.

How Email Logging Actually Works

For an email to be logged, it needs to:

  1. Be received by an email server at the forwarding address
  2. Be forwarded to the webhook endpoint by that email server
  3. Be processed by the webhook with a valid API key

Why BCC Alone Fails

When you BCC an address:

  • The email is sent to that address
  • But if there's no email server configured to receive it, the email is lost
  • The webhook endpoint is never called
  • No email appears in your CRM

The Solution: Email Forwarding

You need to set up an email forwarding service that:

  1. Receives emails at your forwarding address (e.g., log+xxx@yourdomain.com)
  2. Forwards those emails to your webhook URL: https://yourdomain.com/api/integrations/email-logging/webhook?api_key=YOUR_API_KEY

Without email forwarding, BCC will not work.

Setting Up Email Forwarding

SendGrid Inbound Parse:

  1. Sign up for SendGrid
  2. Go to SettingsInbound Parse
  3. Add a new hostname: yourdomain.com
  4. Set the POST URL to: https://yourdomain.com/api/integrations/email-logging/webhook?api_key=YOUR_API_KEY
  5. Configure DNS MX records for your domain
  6. Test by sending an email to log+xxx@yourdomain.com

Mailgun Routes:

  1. Sign up for Mailgun
  2. Go to ReceivingRoutes
  3. Create a route that forwards to: https://yourdomain.com/api/integrations/email-logging/webhook?api_key=YOUR_API_KEY
  4. Configure DNS MX records
  5. Test the forwarding

AWS SES:

  1. Set up AWS SES
  2. Configure email receiving rules
  3. Add an action to forward to your webhook URL
  4. Configure DNS MX records
  5. Verify email receiving works

Option 2: Use Gmail/Outlook Forwarding (Simpler but Limited)

Gmail Forwarding:

  1. Set up a Gmail account for email logging
  2. Go to SettingsForwarding and POP/IMAP
  3. Add forwarding address: log+xxx@yourdomain.com
  4. Configure forwarding rules
  5. Note: Gmail forwarding has limitations and may not work for all use cases

Outlook Forwarding:

  1. Set up an Outlook account
  2. Go to SettingsMailForwarding
  3. Configure forwarding to your webhook endpoint
  4. Note: Outlook forwarding may require additional setup

Option 3: Use a Dedicated Email Service

For production use, we recommend using a dedicated email service provider like SendGrid or Mailgun for better reliability and features.

Webhook Configuration

Understanding the Webhook

The webhook is the endpoint that receives forwarded emails. It must be:

  • Accessible: Publicly accessible via HTTPS
  • Configured: With correct API key
  • Active: Integration must be active

Webhook URL Format

Your webhook URL should look like:

https://yourdomain.com/api/integrations/email-logging/webhook?api_key=YOUR_API_KEY

Getting Your API Key

  1. Go to IntegrationsEmail Logging
  2. Find your integration
  3. Copy the API key
  4. Use it in your webhook URL

Verifying Webhook is Working

  1. Check integration status (should be "Active")
  2. Test webhook endpoint manually
  3. Check server logs for webhook requests
  4. Verify API key is correct

Common Webhook Issues

Issue: "Missing API key"

  • Cause: API key not in URL or header
  • Solution: Add ?api_key=YOUR_API_KEY to webhook URL

Issue: "Invalid API key"

  • Cause: Wrong API key or integration inactive
  • Solution: Verify API key and integration status

Issue: Webhook not receiving emails

  • Cause: Email forwarding not configured
  • Solution: Set up email forwarding service

API Key Issues

Problem: "Missing API key" Error

Symptoms:

  • Webhook returns "Missing API key" error
  • Emails not being processed
  • Integration shows errors

Solution 1: Add API Key to Webhook URL

The webhook URL must include the API key:

  1. Get your API key from IntegrationsEmail Logging
  2. Add it to your webhook URL: ?api_key=YOUR_API_KEY
  3. Update your email forwarding service with the new URL
  4. Test by sending a test email

Solution 2: Use Header Instead (If Supported)

Some email services support API key in headers:

  1. Configure your email service to send x-api-key header
  2. Set header value to your API key
  3. Webhook will accept header instead of query parameter
  4. Test the configuration

Problem: "Invalid API key" Error

Symptoms:

  • Webhook returns "Invalid API key" error
  • API key seems correct but not working
  • Integration shows authentication errors

Solution 1: Verify API Key

  1. Go to IntegrationsEmail Logging
  2. Check your integration's API key
  3. Copy it exactly (no extra spaces)
  4. Update webhook URL with correct key
  5. Test again

Solution 2: Check Integration Status

If API key is invalid:

  1. Go to IntegrationsEmail Logging
  2. Check if integration is "Active"
  3. If inactive, activate it
  4. Generate a new API key if needed
  5. Update webhook URL

Solution 3: Regenerate API Key

If API key still doesn't work:

  1. Go to IntegrationsEmail Logging
  2. Find your integration
  3. Click "Regenerate API Key" or "Disconnect and Reconnect"
  4. Copy the new API key
  5. Update webhook URL with new key
  6. Update email forwarding service
  7. Test again

Email Correlation Issues

Problem: Emails Not Linking to Contacts

Symptoms:

  • Emails appearing in email logging
  • But not linked to any contact
  • "No correlation found" messages
  • Can't see emails in contact records

How Email Correlation Works

Emails are automatically correlated with contacts when:

  • The recipient email (TO or CC) matches an individual's email
  • The recipient email matches an organization's email
  • Auto-correlation is enabled in settings

Solution 1: Enable Auto-Correlation

  1. Go to IntegrationsEmail Logging
  2. Find your integration settings
  3. Enable "Auto-correlation" if available
  4. Save settings
  5. New emails should auto-correlate

Solution 2: Manually Assign Emails

If auto-correlation isn't working:

  1. Go to MailboxAssign (or email logging page)
  2. Find unassigned emails
  3. Click on an email
  4. Select the contact to assign it to
  5. Save assignment

Solution 3: Verify Contact Email Addresses

If emails aren't correlating:

  1. Check that contacts have email addresses
  2. Verify email addresses are correct
  3. Check for typos in email addresses
  4. Ensure email format matches exactly

Solution 4: Check Email Recipients

If correlation still doesn't work:

  1. Check the email's TO and CC fields
  2. Verify recipient emails match contact emails
  3. Check for email aliases or forwarding
  4. Try manual assignment if needed

Common Issues

Issue: "Missing API key" Error

Solution: Make sure the webhook URL includes the api_key query parameter, or the email forwarding service sends the x-api-key header.

Issue: "Invalid API key" Error

Solution:

  • Check that you're using the correct API key from your integration
  • Verify the integration is active (status = 'active')
  • Try disconnecting and reconnecting to generate a new API key

Issue: Emails Appear as Duplicates

Solution: This is expected behavior - the system prevents duplicate emails using the Message-ID header. If you're testing, use a different email each time.

Issue: No Correlation Found

Solution:

  • Check that the recipient email (TO/CC) matches an individual or organization in your CRM
  • Enable auto-correlation in settings
  • Manually assign emails using the /mailbox/assign page

Issue: Integration Not Active

Solution:

  1. Go to IntegrationsEmail Logging
  2. Check integration status
  3. Activate if inactive
  4. Verify configuration is correct

Issue: Webhook Not Receiving Emails

Solution:

  1. Verify email forwarding is configured
  2. Check webhook URL is correct
  3. Test webhook endpoint manually
  4. Check server logs for errors

Issue: Emails Not Appearing After Setup

Solution:

  1. Wait a few minutes (processing may be delayed)
  2. Check integration status
  3. Verify email forwarding is working
  4. Test by sending a new email
  5. Check webhook logs

Prevention Tips

How to Avoid Email Logging Issues

1. Set Up Email Forwarding Correctly

  • Don't rely on BCC alone
  • Use a proper email forwarding service
  • Test forwarding before relying on it

2. Keep API Key Secure

  • Don't share API keys
  • Regenerate if compromised
  • Use API key in webhook URL, not in email content

3. Monitor Integration Status

  • Check integration is active regularly
  • Monitor for errors
  • Address issues promptly

4. Test Regularly

  • Send test emails periodically
  • Verify emails are being logged
  • Check correlation is working

5. Keep Contact Email Addresses Updated

  • Ensure contacts have correct email addresses
  • Update emails when they change
  • Remove invalid email addresses

6. Use Proper Email Format

  • Use standard email format
  • Avoid special characters in email addresses
  • Verify email addresses are valid

7. Document Your Setup

  • Keep track of forwarding configuration
  • Document webhook URL
  • Note any special settings

Still Not Working?

When to Contact Support

If you've tried all solutions and emails still aren't appearing:

1. Gather Information Before contacting support:

  • Integration status
  • API key (masked for security)
  • Webhook URL (without API key)
  • Email forwarding service used
  • Error messages
  • Steps you've already tried
  • Screenshots of configuration

2. Contact Support

  • Email: support@piraja.com (or your support email)
  • In-App: Use the help icon (?) in the interface
  • Knowledge Base: Search for related articles

3. What Support Will Need

  • Your account email
  • Business name
  • Integration type (Email Logging)
  • Email forwarding service
  • Error messages
  • Steps you've tried
  • Configuration screenshots (without API key)

Additional Resources

  • Integration Help: General integration troubleshooting
  • Email Service Documentation: SendGrid, Mailgun, AWS SES guides
  • Webhook Testing: Tools for testing webhook endpoints
Was this helpful?