# Custom template for PM via API?

**URL:** <https://meta.discourse.org/t/custom-template-for-pm-via-api/322585>\
**Category:** Development\
**Tags:** email, rest-api\
**Created:** [August 20, 2024, 10:18pm UTC](https://meta.discourse.org/t/custom-template-for-pm-via-api/322585 "2024-08-20T22:18:30Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![BrianGillespie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/briangillespie/32/105563_2.png) [@BrianGillespie](https://meta.discourse.org/u/BrianGillespie)\
**Post date:** [August 20, 2024, 10:18pm UTC](https://meta.discourse.org/t/custom-template-for-pm-via-api/322585/1 "2024-08-20T22:18:30Z")

</div>

Hi, We’re building a system for reaching out to users when our software crashes, and are thinking of using [Discourse as a private email support portal](https://meta.discourse.org/t/discourse-as-a-private-email-support-portal/34444) and and [Start a new conversation with a customer not yet in Discourse](https://meta.discourse.org/t/start-a-new-conversation-with-a-customer-not-yet-in-discourse/43876) via the API.

When I send the email via the API it seems to use one of the built-in templates and prepends `[McNeel Forum] [PM]` to the subject. While reasonable for other uses of PMs, I’m concerned that our users who are not on the forum will find this confusing or even spammy.

Is there a way to specify a custom template when sending via the API? I don’t see it here:

> **[Discourse API Docs](https://docs.discourse.org/#tag/Posts/operation/createTopicPostPM)**

There is a similar unanswered question here:

> [@Private Message Send API](https://meta.discourse.org/t/private-message-send-api/27593/18):
>
> What if you use an email template as a message? I am going to the email\_templates endpoint, grabbing the template I want, then send that as a private message. However, none of the strings are replaced in the message to the user. The message contains %{site\_name} and ${base\_url} inside the message text. Just wondering how/when in the flow does Discourse substitute these (I couldn’t find any evidence).

---

_[View the full topic](https://meta.discourse.org/t/custom-template-for-pm-via-api/322585)._
