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:
- Be received by an email server at the forwarding address
- Be forwarded to the webhook endpoint by that email server
- 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:
- Receives emails at your forwarding address (e.g.,
log+xxx@yourdomain.com) - 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
Option 1: Use an Email Service Provider (Recommended)
SendGrid Inbound Parse:
- Sign up for SendGrid
- Go to Settings → Inbound Parse
- Add a new hostname:
yourdomain.com - Set the POST URL to:
https://yourdomain.com/api/integrations/email-logging/webhook?api_key=YOUR_API_KEY - Configure DNS MX records for your domain
- Test by sending an email to
log+xxx@yourdomain.com
Mailgun Routes:
- Sign up for Mailgun
- Go to Receiving → Routes
- Create a route that forwards to:
https://yourdomain.com/api/integrations/email-logging/webhook?api_key=YOUR_API_KEY - Configure DNS MX records
- Test the forwarding
AWS SES:
- Set up AWS SES
- Configure email receiving rules
- Add an action to forward to your webhook URL
- Configure DNS MX records
- Verify email receiving works
Option 2: Use Gmail/Outlook Forwarding (Simpler but Limited)
Gmail Forwarding:
- Set up a Gmail account for email logging
- Go to Settings → Forwarding and POP/IMAP
- Add forwarding address:
log+xxx@yourdomain.com - Configure forwarding rules
- Note: Gmail forwarding has limitations and may not work for all use cases
Outlook Forwarding:
- Set up an Outlook account
- Go to Settings → Mail → Forwarding
- Configure forwarding to your webhook endpoint
- 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
- Go to Integrations → Email Logging
- Find your integration
- Copy the API key
- Use it in your webhook URL
Verifying Webhook is Working
- Check integration status (should be "Active")
- Test webhook endpoint manually
- Check server logs for webhook requests
- 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_KEYto 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:
- Get your API key from Integrations → Email Logging
- Add it to your webhook URL:
?api_key=YOUR_API_KEY - Update your email forwarding service with the new URL
- Test by sending a test email
Solution 2: Use Header Instead (If Supported)
Some email services support API key in headers:
- Configure your email service to send
x-api-keyheader - Set header value to your API key
- Webhook will accept header instead of query parameter
- 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
- Go to Integrations → Email Logging
- Check your integration's API key
- Copy it exactly (no extra spaces)
- Update webhook URL with correct key
- Test again
Solution 2: Check Integration Status
If API key is invalid:
- Go to Integrations → Email Logging
- Check if integration is "Active"
- If inactive, activate it
- Generate a new API key if needed
- Update webhook URL
Solution 3: Regenerate API Key
If API key still doesn't work:
- Go to Integrations → Email Logging
- Find your integration
- Click "Regenerate API Key" or "Disconnect and Reconnect"
- Copy the new API key
- Update webhook URL with new key
- Update email forwarding service
- 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
- Go to Integrations → Email Logging
- Find your integration settings
- Enable "Auto-correlation" if available
- Save settings
- New emails should auto-correlate
Solution 2: Manually Assign Emails
If auto-correlation isn't working:
- Go to Mailbox → Assign (or email logging page)
- Find unassigned emails
- Click on an email
- Select the contact to assign it to
- Save assignment
Solution 3: Verify Contact Email Addresses
If emails aren't correlating:
- Check that contacts have email addresses
- Verify email addresses are correct
- Check for typos in email addresses
- Ensure email format matches exactly
Solution 4: Check Email Recipients
If correlation still doesn't work:
- Check the email's TO and CC fields
- Verify recipient emails match contact emails
- Check for email aliases or forwarding
- 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/assignpage
Issue: Integration Not Active
Solution:
- Go to Integrations → Email Logging
- Check integration status
- Activate if inactive
- Verify configuration is correct
Issue: Webhook Not Receiving Emails
Solution:
- Verify email forwarding is configured
- Check webhook URL is correct
- Test webhook endpoint manually
- Check server logs for errors
Issue: Emails Not Appearing After Setup
Solution:
- Wait a few minutes (processing may be delayed)
- Check integration status
- Verify email forwarding is working
- Test by sending a new email
- 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)
Related Articles
Additional Resources
- Integration Help: General integration troubleshooting
- Email Service Documentation: SendGrid, Mailgun, AWS SES guides
- Webhook Testing: Tools for testing webhook endpoints