Notifications
Agents and visitors can receive an email when new chat messages arrive while they are offline. Templates and delivery are configured under Settings → Notifications.
Help links on Agent email notifications, User email notifications, and Email notifications via cron job point here.
Overview
| Setting | Who receives mail | When |
|---|---|---|
| Agent email notifications | Offline agents/admins | User sends a message (rules below) |
| User email notifications | Offline users with an email | Agent sends a reply |
| Email notifications via cron job | Same as above | Batches one email with recent conversation lines instead of instant single-message mail |
Every outbound message uses Settings → Notifications → Email template. Include \{content\} — it is required and is replaced with the body from User notification email or Agent notification email.
Email notifications for agents
Enable Settings → Notifications → Agent email notifications.
Routing matches push notifications:
- First message — if the conversation has a department, mail goes to offline agents/admins in that department (and agents with no department). If assigned to a specific agent, only that agent. Otherwise offline agents/admins by department rules.
- Later messages — only the last agent in the conversation.
- Offline only — online agents do not receive these emails.
- Queue — no email while the user is waiting in queue (same as push).
- Human takeover — if Dialogflow/chatbot can answer, no email until human takeover is needed.
- Do not send notifications to admins — excludes admins from recipient lists when enabled.
Email notifications for users
Enable Settings → Notifications → User email notifications.
When an agent sends a message, the user receives email only if they are offline. One email per notification cycle; follow-up agent messages do not send another immediate alert until the cycle resets.
Users must have a valid email on their profile (registration or lead capture).
Email templates and merge fields
Edit content under Settings → Notifications:
| Block | Used for |
|---|---|
| Email template | Wrapper for all emails (\{content\} required) |
| User notification email | Subject + body when agents message users |
| Agent notification email | Subject + body when users message agents |
You can use plain text or HTML. New lines in the editor are converted to <br />.
Merge fields
| Field | Description |
|---|---|
\{recipient_name\} | Name of the user or agent receiving the email |
\{sender_name\} | Name of whoever sent the message that triggered the email |
\{sender_profile_image\} | Profile image URL of the sender |
\{message\} | Text of the message that triggered the notification (cron mode may include a longer conversation snippet) |
\{attachments\} | HTML links to attachments on that message |
\{conversation_link\} | Link to open the conversation in the admin area — agent emails only |
\{conversation_url_parameter\} | Query string for user-facing deep links (?conversation=…&token=…) — user emails |
\{conversation_id\} | Numeric conversation ID |
Test delivery with Send a user email notification or Send an agent email notification in the same settings area.
Cron job (optional)
For richer digests (recent messages in one mail, still one send per conversation batch), enable Email notifications via cron job and call the cron URL on a schedule.
Tenant bot URL (typical Aysali workspace):
https://your-bot-host.example/include/api.php?email-notifications=true
Example crontab (every 59 minutes):
*/59 * * * * wget -q -O /dev/null "https://your-bot-host.example/include/api.php?email-notifications=true"
Replace your-bot-host.example with your workspace bot host (the same origin as admin.php, e.g. from the Aysali tenant portal).
SMTP and delivery
Outgoing mail uses Settings → Notifications → SMTP:
| Mode | When to use |
|---|---|
| Use Aysali SMTP | Hosted workspaces with platform SMTP enabled (recommended) |
| SMTP Settings | Your own host, port, username, and password |
If SMTP is not configured, PHP/mail() on the server may be used — often unreliable or marked as spam.
Troubleshooting
| Issue | What to check |
|---|---|
| No mail at all | Send a test email from Notifications settings; check browser console for SMTP errors |
| Hosting / spam | Enable Use Aysali SMTP or a reputable provider (e.g. SendGrid) |
| SMTP auth fails | Verify host, port (465/587), username, password |
| Gmail / Google Workspace | Use an App Password, host smtp.gmail.com, port 465 or 587; check Workspace API/app restrictions |
| Wrong content | Confirm Email template contains \{content\} and per-audience templates are filled in |
Platform SMTP and third-party mail providers are outside Aysali Bot application support when misconfigured on your side — fix SMTP credentials or contact your mail provider.