Skip to main content

Send Message with Custom Template

Custom Template​

Refer to the Official Documentation for details on using custom templates to send messages via KakaoTalk.

Send Message to Myself​

You can send a message using the sendCustomTemplateToMe() function.

This function is defined as follows:

export function sendCustomTemplateToMe(params: {
templateId: number;
templateArgs?: Record<string, string>;
})
  • templateId: The message template specified in the console.
  • templateArgs: Template arguments. All values must be passed as strings.

Send Message to Friends​

You can send a message using the sendCustomTemplateToFriends() function.

This function is defined as follows:

export function sendCustomTemplateToFriends(params: {
templateId: number;
templateArgs?: Record<string, string>;
receiverUuids: string[];
includeFailureInfo?: boolean;
})
  • templateId: The message template specified in the console.
  • templateArgs: Template arguments. All values must be passed as strings.
  • receiverUuids: List of friend uuids to send the message to. You can obtain these from the social package's Select KakaoTalk Friends or Get KakaoTalk Friends.

Pass includeFailureInfo: true to receive successful UUIDs and failures grouped by error. Omit it to receive the successful UUID array. See message results.

info

Refer to the Component Types for detailed component types.

If you encounter any issues, refer to the Troubleshooting section.