Ordway allows you to create reusable, context-aware email templates and use them across customer records, workflows, APIs, and MCP integrations.
Custom email templates help standardize email content while allowing information from the associated Ordway record to populate the message. You can also override email details, such as the subject and recipients, when sending an email.
Custom email templates work alongside Ordway's existing system email templates and do not replace the existing email functionality.
Contents
- Overview
- Manage Custom Email Templates
- Supported Template Contexts
- Send Emails from Customer Records
- Use Custom Email Templates in Workflows
- Send Emails Using the API
- Send Emails Using MCP
- Email Validation and Security
- Monitor Email Activity
- Troubleshooting
- Frequently Asked Questions
Overview
Custom email templates provide a reusable way to send emails using information associated with Ordway records.
You can create templates for specific record types, such as Customers, Invoices, Subscriptions, and Payments. You can also create templates using the General context. General templates are not restricted to a single record type and can be selected when sending emails from supported objects, including Customers, Invoices, and Subscriptions.
Custom email templates can be used in the following ways:
- Manage Templates: Create, edit, and delete reusable custom email templates.
- Customer records: Select and send an enabled custom email template from a Customer record or the Customer list.
- Workflows: Configure a workflow email action to use a custom template and the associated record context.
- API: Send emails using an existing template or provide the recipient, subject, and body directly.
- MCP: Request an email using a template name and record reference, with optional changes to the email.
Manage Custom Email Templates
Ordway provides a separate section for managing custom email templates.
Access Manage Templates
- In Ordway, navigate to Setup > Manage Templates.
- Scroll to the Custom Email Templates section at the bottom of the page.
Create a Custom Email Template
- Navigate to Setup > Manage Templates.
- Locate the Custom Email Templates section.
- Click ADD TEMPLATE. The New Email Template dialog box is displayed.
- Configure the custom email template.
- Click SAVE to save the template.
The custom template is available for use according to its configured context and enabled status.
Edit a Custom Email Template
- Navigate to Setup > Manage Templates.
- Locate the required template in the Custom Email Templates section.
- Click Edit.
- Update the template configuration.
- Save the changes.
Delete a Custom Email Template
- Navigate to Setup > Manage Templates.
- Locate the custom email template.
- Click Delete.
- Review the warning if the template is used by one or more workflows.
- Confirm the deletion.
Important: Ordway displays a warning identifying workflows that use the template. The warning does not prevent deletion. If a workflow references a deleted or disabled template, its email action fails when the workflow runs.
Before deleting a template, review the workflows that depend on it.
Supported Template Contexts
A template context determines which Ordway record supplies the information used to populate the email.
Custom email templates support the following contexts:
| Context | Description |
| Invoice | Email associated with an Invoice record. |
| Subscription | Email associated with a Subscription record. |
| Customer | Email associated with a Customer record. |
| Payment | Email associated with a Payment record. |
| Credit | Email associated with a Credit record. |
| DebitMemo | Email associated with a Debit Memo record. |
| Quote | Email associated with a Quote record. |
| Refund | Email associated with a Refund record. |
| Statement | Email associated with a Statement record. |
| Order | Email associated with an Order record. |
| General | Templates that can be used across supported record types rather than being restricted to a specific record type. |
A general template does not use record-specific context. Unbound emails do not automatically attach a PDF from an Ordway record.
General Templates Across Objects
General templates can be selected when sending emails from different supported objects, including Customers, Invoices, and Subscriptions. They are not restricted to a single record type.
A General template does not use record-specific template context and does not automatically attach a PDF from the associated Ordway record.
Send Emails from Customer Records
You can send an email using an enabled custom email template directly from a Customer record or the Customer list.
Send an Email from a Customer Record
- Open the required Customer record.
- Open the Actions menu.
- Select Send Email.
- Select an available custom email template.
- Review the populated email details.
- Verify the recipient, subject, and email body.
- Send the email.
Send an Email from the Customer List
- Navigate to the Customers page.
- Locate the required Customer.
- Open the Customer's Actions menu.
- Select Send Email.
- Select an available custom email template.
- Review the email details and send the email.
Available Templates
When you use the Send Email action from a Customer record or the Customer list, Ordway lists:
- Enabled custom email templates with the Customer context.
- Enabled custom email templates with the General context.
General templates are also available when sending emails from other supported object types, such as Invoices and Subscriptions. The available list includes templates configured for the relevant record context and enabled General templates.
A tooltip explains which templates are available for selection.
When you select a template, Ordway populates the email form using the template definition.
Before sending, verify that the recipient, subject, and body are populated. Ordway prevents sending when any of these required fields are blank.
Use Custom Email Templates in Workflows
You can use custom email templates in a workflow's Send an Email action. The workflow supplies the record context so the template can populate its merge fields using the associated Ordway record.
Configure the Send an Email Action
- Navigate to Workflows.
- Create a workflow or open an existing workflow.
- Add or edit the Send an Email action.
- Configure the email action.
The action includes the following fields:
| Field | Description |
| Label Name | Name displayed for the workflow action. |
| API Name | Unique API name for the workflow action. |
| Template | Custom email template to use for the email. |
| Context ID | Record ID or workflow reference used to populate the template's context. |
| Recipients | Email recipients. |
| CC | Email addresses to copy on the message. |
| BCC | Email addresses to blind-copy on the message. |
Configure the Template Context
Select the custom email template and provide the appropriate Context ID.
The Context ID must resolve to a record of the type expected by the template.
For example, when using an Invoice template, provide the Invoice record ID or a workflow reference that resolves to the Invoice record ID.
The workflow can use a reference from an earlier step. For example:
lookup_invoice.data.id
This allows the email template to retrieve information associated with the Invoice context.
Configure Recipients and Copies
Configure the following fields as required:
- Recipients: Email addresses that receive the message.
- CC: Additional recipients copied on the message.
- BCC: Additional recipients blind-copied on the message.
The recipient must resolve to a valid email address. If the template and workflow do not provide a recipient, the email action fails.
Backward Compatibility
Custom email template support extends the existing workflow email functionality.
- Existing email actions continue to work with their current configurations.
- You do not need to replace existing email actions to maintain their current behavior.
- Custom email templates provide additional functionality without changing the existing system template types.
Send Emails Using the API
Ordway extends the send_mail API to support sending emails using custom email templates.
You can use the API to:
- Send an email using a saved custom email template.
- Specify the associated Ordway record using a context ID.
- Send an email without a saved template by providing the recipient, subject, and body.
Send an Email Using a Template
Send a POST request to: /api/v1/send_mail
Example
|
curl -s -X POST "$ORDWAY_HOST/api/v1/send_mail" \ -H "X-User-Email: $ORDWAY_EMAIL" \ -H "X-User-Token: $ORDWAY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "template_name": "Invoice Follow-Up", "context_id": "INV-00001" }' |
In this example:
- template_name identifies the enabled custom email template.
- context_id identifies the Invoice record used to populate the template.
Send an Email Without a Template
You can send an email by supplying the recipient, subject, and body directly.
Example
|
curl -s -X POST "$ORDWAY_HOST/api/v1/send_mail" \ -H "X-User-Email: $ORDWAY_EMAIL" \ -H "X-User-Token: $ORDWAY_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "recipients": "demo@example.com", "subject": "Scheduled maintenance tonight", "body": "Ordway will be unavailable from 10:00 to 10:15 pm." }' |
A template is not required when the caller supplies the required email details.
For additional API request and response details, refer to the Ordway API reference for send_mail.
Send Emails Using MCP
You can use natural-language requests through MCP to send emails using custom templates.
Send an Email Using a Template
Provide the template name and the associated record.
Example request:
Send the "Invoice Follow-Up" email for invoice INV-00001.
Ordway uses the template name and Invoice ID to identify the email template and its record context.
Send an Email with Changes
You can request changes for an individual send without changing the saved template.
Example request:
Send the "Invoice Follow-Up" email for invoice INV-00001, but change the subject to "Quick reminder" and copy demo@example.com.
In this example:
- The saved template provides the email content.
- The subject is overridden for this send.
- The specified email address is added as a CC recipient.
These changes apply to the individual email and do not update the saved template.
Email Validation and Security
Ordway validates email content and recipient information before sending.
Required Email Information
An email must have:
- At least one recipient.
- A subject.
- A body.
The recipient can come from the template or the caller. If neither supplies a recipient, the send fails and the error identifies the missing information.
The default template does not include a recipient intentionally. This allows the recipient to be supplied by the caller or the workflow.
Script and Event Handler Sanitization
Subject and body content supplied by callers through the API, MCP, or workflow overrides is cleaned of scripts and event handlers before the email is sent.
This helps prevent executable script content from being included in caller-provided email content.
Template and Context Validation
Ordway validates the requested template and its context.
A template must be enabled and its name must match the requested template. The context ID must identify the expected record type for the template.
If a template cannot be found or the required information cannot be resolved, the email send fails.
Monitor Email Activity
Ordway records email activity in the relevant areas.
| Activity | Where it is recorded |
| Email sent using a record context | Customer email history. |
| Email sent through a workflow | Workflow email log entry. |
| Custom email template created or changed through the API | Audit log entry. |
Review Workflow Email Logs
To review a workflow email execution:
- Navigate to Workflows.
- Open the relevant workflow.
- Open its Logs.
- Review the execution status and failure information.
- Open the relevant log entry to inspect the available details.
Troubleshooting
| Issue | Possible cause | Resolution |
| Custom email template is not available | The template is disabled or its context is not supported by the selected action. | Verify that the template is enabled and that its context matches the action. |
| Template not found | The requested template name does not exactly match an enabled custom email template. | Open Setup > Manage Templates and verify the template name, including capitalization and spacing, and confirm that it is enabled. |
| Email cannot be sent because the recipient is blank | Neither the template nor the caller supplies a valid recipient. | Configure a recipient in the template or provide one in the send request or workflow. |
| Workflow email action fails after a template is deleted | The workflow references a template that no longer exists. | Edit the workflow action and select an available enabled template. |
| Template merge fields do not populate correctly | The Context ID does not identify the expected record type, or the template uses merge fields that are unavailable for that context. | Verify the Context ID and confirm that the template merge fields are supported for the selected record context. |
| Email content is missing | The template or caller does not provide a subject or body. | Verify the template definition or provide the required subject and body. |
Frequently Asked Questions
| Questions | Answers |
| Does creating a custom email template replace Ordway's existing system templates? | No. Custom email templates are additional templates. Existing system templates, such as Invoice Creation, continue to work as before. System templates cannot be deleted through Custom Email Templates. |
| Which records can a custom email template use? | Custom email templates support Invoice, Subscription, Customer, Payment, Credit, Debit Memo, Quote, Refund, Statement, and Order contexts. You can also use the General context for templates that are available across supported record types, rather than being restricted to one specific object. |
| Can I use a General template when sending an email from a Customer, Invoice, or Subscription? | Yes. General templates can be selected when sending emails from different supported object types, including Customers, Invoices, and Subscriptions. However, a General template does not use record-specific template context or automatically attach the record's PDF. |
| What happens if a workflow uses a deleted or disabled template? |
Ordway displays a warning when you delete a template that is used by workflows. The warning identifies the affected workflows but does not block deletion. If the workflow later runs with a reference to a missing or disabled template, its email action fails. |
| Can I change the subject or recipients for one email without editing the saved template? | Yes. You can provide changes for an individual send through supported caller overrides, such as an API or MCP request. These changes do not modify the saved template. |
| What happens if no recipient is provided? | Ordway does not send the email. The recipient must come from the template or the caller. If neither supplies one, the send fails with a message identifying the missing information. |
| Can custom email templates contain scripts? | Caller-provided subject and body content is cleaned of scripts and event handlers before sending. This applies to content supplied through the API, MCP, and workflow overrides. |
| Where can I review emails sent through workflows? | Review the corresponding workflow execution logs. Workflow email actions write entries to the workflow email log. Emails associated with records are also recorded in customer email history. |
| Are template changes recorded? | Yes. Creating or changing a custom email template through the API creates an audit log entry. |
Comments
0 comments
Please sign in to leave a comment.