Email setup
📧 Email Service Setup¶
After deploying infrastructure, configure Azure Communication Services (ACS) Email for agent tools that send emails (e.g., claim confirmations, notifications).
Optional Service
Email is only required if your agents use email tools. Voice calls work without it.
Quick Setup¶
Step 1: Get Connection String¶
- Go to Azure Portal → your ACS resource
- Select Settings → Keys in the left navigation
- Copy the Connection string (Primary or Secondary)
Step 2: Get Sender Address¶
- In your ACS resource, select Email → Try Email
- Note the Send email from dropdown value (e.g.,
05d1f9c1-c240-4502-a370-4b039d729fea.azurecomm.net) - Your sender address is:
DoNotReply@<that-domain>
Step 3: Update Environment¶
Add to your .env:
# ACS Email Configuration
AZURE_COMMUNICATION_EMAIL_CONNECTION_STRING=endpoint=https://<your-acs>.communication.azure.com/;accesskey=<key>
AZURE_EMAIL_SENDER_ADDRESS=DoNotReply@<your-domain>.azurecomm.net
Step 4: Restart Backend¶
Verifying Configuration¶
Test via Portal¶
- Go to ACS resource → Email → Try Email
- Enter a recipient email
- Click Send
- Check your inbox
Test via API¶
curl -X POST "http://localhost:8010/api/v1/tools/test-email" \
-H "Content-Type: application/json" \
-d '{"to": "your-email@example.com", "subject": "Test", "body": "Hello from ACS!"}'
Environment Variables¶
| Variable | Required | Description |
|---|---|---|
AZURE_COMMUNICATION_EMAIL_CONNECTION_STRING |
Yes | ACS connection string with email permissions |
AZURE_EMAIL_SENDER_ADDRESS |
Yes | Sender email (e.g., DoNotReply@xxx.azurecomm.net) |
Custom Domains (Optional)¶
By default, emails come from DoNotReply@xxx.azurecomm.net. For a custom domain:
- Go to ACS resource → Email → Domains
- Click Add domain
- Follow DNS verification steps
- Update
AZURE_EMAIL_SENDER_ADDRESSwith your custom sender
📚 Full guide: Azure Docs - Email Domains
Troubleshooting¶
| Symptom | Cause | Fix |
|---|---|---|
| "Email service not configured" | Missing env vars | Add AZURE_COMMUNICATION_EMAIL_CONNECTION_STRING and AZURE_EMAIL_SENDER_ADDRESS |
| "Invalid sender address" | Wrong format | Use DoNotReply@<domain>.azurecomm.net format |
| Emails not received | Spam filter | Check spam folder; use custom domain for production |
| 401 Unauthorized | Invalid connection string | Regenerate keys in Azure Portal |
Related¶
- Phone Number Setup - Configure PSTN calling
- Local Development - Full local setup guide