In a discussion titled “Custom template for PM via API?” under the Dev category with tags email and rest-api, BrianGillespie asks whether it’s possible to use a custom template when sending private messages via the Discourse API, noting that the default subject prefix [McNeel Forum] [PM] may confuse non-forum users. He references existing guides and an unanswered thread on the topic. pfaffman replies that while Discourse allows global text customization via Customize text in Discourse, there’s no built-in way to differentiate API-sent messages from front-end ones. BrianGillespie follows up, asking if a plugin already exists for this purpose. pfaffman clarifies that since the API powers the front end, no distinction exists by default — achieving different text would require a custom plugin that either adds a new endpoint or accepts a parameter to modify the subject line. No existing plugin currently fulfills this need.
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:
You can customize the text of that Customize text in Discourse but not different for api and front end. If you need it different, you’ll need a plugin.