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 and and Start a new conversation with a customer not yet in Discourse 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:
https://docs.discourse.org/#tag/Posts/operation/createTopicPostPM
There is a similar unanswered question here:
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).
pfaffman
(Jay Pfaffman)
August 20, 2024, 11:34pm
2
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.
Thank you for the reference to customizing the text. Ideally, we’d have different text from the API - is there already a plugin for this? Cheers
pfaffman
(Jay Pfaffman)
August 21, 2024, 9:13am
4
No. The API is how the front end does all of its work. There is no distinction between the API and the ux.
You would need a plugin that either created a new endpoint or took a parameter to change the subject.
1 Like