Configure custom emails
Your website and Daikoku are almost ready to be published, but before that, you need to configure the email content.
Synchronize emails
The first step is to fetch the Daikoku's emails using the following command:
daikoku pull mails
Update the email layout
Each email is wrapped by the email layout located at src/mails/root/tenant-mail-template/en/page.html
or src/mails/root/tenant-mail-template/fr/page.html
.
Open the src/mails/root/tenant-mail-template/en/page.html
file and update the contents.
<h1>Dear Developer,</h1>
[email]
Best regards,
Then push the modification to your Daikoku.
daikoku push
Perform an action in Daikoku and check the changes in the received emails.
Update the email for a specific event
Each Daikoku event triggers the generation of an email notification. For each event, you can find a corresponding folder in the src/mails directory.
Folder Structure
Event-based folders: Each event email has its dedicated folder named after the event id (e.g., new-user, team-invitation, etc.). Language-specific subfolders: Within each event folder, you will find two subfolders: fr: Contains templates for emails in French. en: Contains templates for emails in English.
What to Expect in Each Folder
Subject and body templates: Each subfolder includes localized email templates for the subject (title) and body (body). Parameter documentation: Each email supports specific parameters to dynamically populate user-specific or event-specific information. The details for these parameters are listed in this document under each event.
Purpose of this List
This document provides a comprehensive overview of all Daikoku email events, their descriptions, and the parameters required to customize them. This ensures consistency in email content and simplifies localization for multiple languages.
A API access demand has been accepted
This email is sent to the team admin who requested access to the API after this request has been accepted
Title: mail-acceptation-titleBody: mail-api-access-acceptation-bodyParameters:
- user: The name of the user who created the subscription request
- apiName: The name of the API
- api_data: The API as a JSON object
- consumer_team_data: The team that created the request, as a JSON object
- producer_team_data: The team that owns the API, as a JSON object
A API access demand has been rejected
This email is sent to the team admin who requested access to the API after this request has been rejected
Title: mail-rejection-titleBody: mail-api-access-rejection-bodyParameters:
- user: The name of the user who created the subscription request
- apiName: The name of the API
- api_data: The API as a JSON object
- recipient_data: The recipient of the email as a JSON object
- consumer_team_data: The team that created the request, as a JSON object
- producer_team_data: The team that owns the API, as a JSON object
- tenant_data: The tenant/organization as a JSON object
API access request
This email is sent when a Daikoku user requests access to a team for an API with visibility set to public with permission.
Title: mail-api-access-titleBody: mail-api-access-bodyParameters:
- user: The name of the user requesting access
- apiName: The name of the subscribed API
- teamName: The name of the team requesting access
- link: The URL to the notifications page
- api_data: The API information as a JSON object
- consumer_team_data: The team requesting access to the API, as a JSON object
- producer_team_data: The team owning the API, as a JSON object
- user_data: The user requesting access to the API, as a JSON object
- notification_data: The notification information as a JSON object
A subscription request has been accepted
This email is sent to team administrators who made a subscription request after the request has been accepted.
Title: mail-acceptation-titleBody: mail-api-subscription-acceptation-bodyParameters:
- user: The name of the user who created the subscription request
- apiName: The name of the API
- team: The name of the team that requested the subscription
- link: The URL to the created API key
- api_data: The API information as a JSON object
- usagePlan_data: The usage plan information as a JSON object
- consumer_team_data: The team that created the request, as a JSON object
- producer_team_data: The team that owns the API, as a JSON object
- user_data: The user who created the request, as a JSON object
- subscription_data: The subscription information as a JSON object
A subscription request has been rejected
This email is sent to the team administrator who made the subscription request after the request has been rejected.
Title: mail-rejection-titleBody: mail-api-subscription-rejection-bodyParameters:
- user: The name of the user who created the subscription request
- apiName: The name of the API
- teamName: The name of the team that requested the subscription
- message: The rejection message provided by the producer team
- api_data: The API information as a JSON object
- usagePlan_data: The usage plan information as a JSON object
- consumer_team_data: The team that created the request, as a JSON object
- producer_team_data: The team that owns the API, as a JSON object
- user_data: The user who created the request, as a JSON object
- subscriptionDemand_data: The subscription demand information as a JSON object
A user has rejected a transfer of ownership for an API
This email is sent to team administrators when a user rejects the request to transfer ownership of an API to another team.
Title: mail-rejection-titleBody: mail-api-transfer-ownership-rejection-bodyParameters:
- apiName: The name of the API being transferred
- teamName: The name of the requested team
- producer_team_data: The team requesting the transfer, as a JSON object
- requested_team_data: The team that received the transfer request, as a JSON object
- api_data: The transferred API information as a JSON object
A user has requested a subscription
This email is sent to team administrators when a user requests a new API key and requires validation by an API administrator.
Title: mail-apikey-demand-titleBody: mail-apikey-demand-bodyParameters:
- user: The name of the user who created the subscription request
- apiName: The name of the subscribed API
- team: The name of the team making the subscription request
- link: A link to the notifications page
- consumer_team_data: The team that owns the subscription, as a JSON object
- producer_user_data: The user or team that owns the API, as a JSON object
- api_data: The API information as a JSON object
- usagePlan_data: The usage plan details as a JSON object
- notification_data: The notification information as a JSON object
- user_data: The user's information as a JSON object
- recipient_data: The user receiving the email, as a JSON object
- subscriptionDemand_data: The subscription request as a JSON object
- tenant_data: The tenant information as a JSON object
API Subscription Secret Refresh
This email is sent when an API key secret has been refreshed by an administrator.
Title: mail-apikey-refresh-titleBody: mail-apikey-refresh-bodyParameters:
- apiName: The name of the subscribed API
- planName: The name of the subscribed usage plan
- api_data: The subscribed API details as a JSON object
- usagePlan_data: The subscribed usage plan details as a JSON object
- subscription_data: The subscription details as a JSON object
- consumer_team_data: The team owning the subscription, as a JSON object
- tenant_data: The tenant details as a JSON object
- recipient_data: The user receiving the email, as a JSON object
API Subscription Secret Rotation
This email is sent when an API key secret is pending rotation.
Title: mail-apikey-rotation-titleBody: mail-apikey-rotation-bodyParameters:
- apiName: The name of the subscribed API
- planName: The name of the subscribed usage plan
- api_data: The subscribed API details as a JSON object
- usagePlan_data: The subscribed usage plan details as a JSON object
- subscription_data: The subscription details as a JSON object
- consumer_team_data: The team owning the subscription, as a JSON object
A Subscription Demand Requires Checkout
This email is sent to the team that created a subscription demand when the demand is at the checkout stage.
Title: mail-checkout-titleBody: mail-checkout-bodyParameters:
- api.name: The name of the API related to the subscription demand
- api.plan: The name of the usage plan associated with the subscription demand
- link: The redirect URL leading to the checkout page
- api_data: The API details as a JSON object
- usagePlan_data: The usage plan details as a JSON object
- consumer_team_data: The team that created the demand, as a JSON object
- producer_team_data: The team that owns the API, as a JSON object
- user_data: The user who created the demand, as a JSON object
- subscriptionDemand_data: The subscription demand details as a JSON object
A Team or Organization is Contacted by a User
This email is sent to the entity (team or tenant/organization) contacted by a user using the dedicated contact form.
Title: mail-contact-titleBody: mail-contact-contactParameters:
- user: The name of the user who sent the contact email
- email: The email address of the user
- subject: The subject line of the contact email
- body: The body content of the email
- contact: The contacted team or organization as a JSON object
- user_data: The user who sent the email, represented as a JSON object
A User Contact with Team or Organization
This email is sent to the user who contacted a team administrator via the dedicated contact form.
Title: mail-contact-titleBody: mail-contact-senderParameters:
- user: The name of the user who sent the contact email
- email: The email address of the user
- subject: The subject of the contact email
- body: The body content of the email
- contact: The contacted team or organization, represented as a JSON object
- user_data: The user who sent the email, represented as a JSON object
API New Post Notification
This email is sent to team administrators who are subscribed to an API, notifying them that an API administrator has created a new post.
Title: mail-create-post-titleBody: mail-create-post-bodyParameters:
- user: The name of the user who created the post
- apiName: The name of the API
- teamName: The name of the team that owns the API
- link: The URL to the post page
- api_data: The API, represented as a JSON object
- consumer_team_data: The team consuming the API, represented as a JSON object
- producer_team_data: The team owning the API, represented as a JSON object
- user_data: The user who created the post, represented as a JSON object
- post_data: The post, represented as a JSON object
New Team Creation
This email is sent to the team admin who just created a team, prompting them to validate the team's contact email address.
Title: mail-create-team-token-titleBody: mail-create-team-token-bodyParameters:
- user: The name of the user who created the team
- teamName: The name of the newly created team
- link: The URL to validate the team's contact email
- team_data: The created team, represented as a JSON object
- recipient_data: The user who created the team, represented as a JSON object
- tenant_data: The tenant, represented as a JSON object
API New Issue Posted
This email is sent to API administrators when a user posts a new issue.
Title: mail-new-issue-titleBody: mail-new-issue-bodyParameters:
- user: The name of the user who posted the issue
- apiName: The name of the API
- teamName: The name of the team that owns the API
- link: The URL to the issue page
- api_data: The API as a JSON object
- producer_team_data: The team that owns the API, represented as a JSON object
- user_data: The user who posted the issue, represented as a JSON object
- issue_data: The issue, represented as a JSON object
New Message Received
This email is sent to tenant administrators when a user posts a new message.
Title: mail-new-message-titleBody: mail-new-message-bodyParameters:
- body: The content of the message
- tenant_data: The tenant or organization as a JSON object
- user_data: The user who posted the message, represented as a JSON object
- message_data: The message, represented as a JSON object
Finalize New Account Creation
This email is sent to the user to finalize account creation and validate their email address.
Title: mail-new-user-titleBody: mail-new-user-bodyParameters:
- tenant: The name of the tenant or organization
- link: The URL for validating the account
- tenant_data: The tenant or organization as a JSON object
- account_data: The information provided by the user for account creation, as a JSON object
A subscription demand needs a validation
This email is sent to the registered email address as part of the subscription demand validation process.
Title: mail-subscription-validation-titleBody: mail-subscription-validation-bodyParameters:
- user: The name of the user who created the subscription demand
- team: The name of the team requesting the subscription
- body: The generated email body set up during the validation step
- urlAccept: The URL to accept the demand
- urlDecline: The URL to decline the demand
- api_data: The API as a JSON object
- usagePlan_data: The usage plan as a JSON object
- consumer_team_data: The team that created the demand, as a JSON object
- producer_team_data: The team owning the API, as a JSON object
- user_data: The user who created the demand, as a JSON object
- subscriptionDemand_data: The subscription demand as a JSON object
A team admin sends an invitation to a person, with an existing daikoku account, to become a new member
This email is sent to an existing user when a team admin invites him to become a member of his team.
Title: mail-team-invitation-titleBody: mail-team-invitation-bodyParameters:
- teamName: The name of the team
- link: The link to accept invitation
- user: The name of the admin inviting
- sender_data: The user inviting as a JSON object
- recipient_data: The invited user, recipient of the email as a JSON object
- tenant_data: The tenant/organization as a JSON object
- team_data: The team as a JSON object
- notification_data: The notification as a JSON object
A team admin sends an invitation to a person, without a daikoku account, to become a new member
This email is sent to a person, without any daikouk account, when a team admin invites him to become a member of his team.
Title: mail-user-invitation-titleBody: mail-user-invitation-bodyParameters:
- teamName: The name of the team
- link: The link to accept invitation
- sender: The name of the admin inviting
- sender_data: The user inviting as a JSON object
- recipient_data: The invited user, recipient of the email as a JSON object
- tenant_data: The tenant/organization as a JSON object
- team_data: The team as a JSON object
- notification_data: The notification as a JSON object
A user invitation has been rejected
This email is sent to the team admin who invited a user to their team, informing them that the invitation has been declined.
Title: mail-rejection-titleBody: mail-user-invitation-rejection-bodyParameters:
- user: The name of the invited user
- teamName: The name of the team
- user_data: The invited user as a JSON object
- recipient_data: The recipient of the email as a JSON object
- tenant_data: The tenant/organization as a JSON object
- producer_team_data: The team as a JSON object
- notification_data: The notification as a JSON object
A user has accepted an invitation to join a team
This email is sent to team admins when a user accepts an invitation to join their team.
Title: mail-acceptation-titleBody: mail-user-invitation-acceptation-bodyParameters:
- user: The name of the user who accepted the invitation
- teamName: The name of the team
- team_data: The team as a JSON object
- user_data: The user as a JSON object
Each folder structure contains two subfolders, each with a page.html
file.
For example, the following content can be overridden to modify the layout of the email.
root
tenant-mail-template
├── en
│ └── page.html
└── fr
└── page.html