Skip to content
GitHubXDiscord

MessageTemplate

The MessageTemplate resource allows you to manage AWS Wisdom MessageTemplates that help in creating structured messages for various channels. This resource facilitates the configuration and customization of message templates used in customer service scenarios.

Create a basic message template with required properties and a common optional property.

import AWS from "alchemy/aws/control";
const messageTemplate = await AWS.Wisdom.MessageTemplate("customerInquiryTemplate", {
Name: "Customer Inquiry",
KnowledgeBaseArn: "arn:aws:wisdom:us-east-1:123456789012:knowledge-base/knowledge-base-id",
ChannelSubtype: "Email",
Content: {
type: "text/plain",
value: "Thank you for reaching out! We will get back to you shortly."
},
Description: "Template for customer inquiry responses"
});

Configure a message template with additional attributes such as grouping configuration and default attributes.

const advancedMessageTemplate = await AWS.Wisdom.MessageTemplate("technicalSupportTemplate", {
Name: "Technical Support",
KnowledgeBaseArn: "arn:aws:wisdom:us-east-1:123456789012:knowledge-base/knowledge-base-id",
ChannelSubtype: "Chat",
Content: {
type: "text/html",
value: "<p>Our technical support team is here to help you!</p>"
},
GroupingConfiguration: {
GroupBy: "issueType"
},
DefaultAttributes: {
urgency: "high",
priority: "immediate"
}
});

Create a message template for a specific language to cater to international customers.

const multilingualTemplate = await AWS.Wisdom.MessageTemplate("spanishResponseTemplate", {
Name: "Respuesta en Español",
KnowledgeBaseArn: "arn:aws:wisdom:us-east-1:123456789012:knowledge-base/knowledge-base-id",
ChannelSubtype: "SMS",
Language: "es",
Content: {
type: "text/plain",
value: "Gracias por contactarnos. Estamos aquí para ayudar."
}
});

Create a message template with tags for better organization and management.

const taggedMessageTemplate = await AWS.Wisdom.MessageTemplate("salesFollowUpTemplate", {
Name: "Sales Follow-Up",
KnowledgeBaseArn: "arn:aws:wisdom:us-east-1:123456789012:knowledge-base/knowledge-base-id",
ChannelSubtype: "Email",
Content: {
type: "text/plain",
value: "We appreciate your interest in our products. Do you have any questions?"
},
Tags: [
{ Key: "Department", Value: "Sales" },
{ Key: "Purpose", Value: "Follow-Up" }
]
});