Plain Text Support in notifications.sendEmail(...)?
Hi everyone,
I'm using notifications.sendEmail(...) in a YouTrack workflow and noticed that it only accepts HTML content for emails. However, users in YouTrack can set their notification preference to plain text.
Is there a way to respect that preference when sending custom emails?
Or perhaps a hidden option to include both plain text and HTML (e.g., via multipart/alternative)?
Best Regards
Please sign in to leave a comment.
Hi Konstantin,
I'm Sergey from the YouTrack Team. Thanks for reaching out!
There seems to be a small misunderstanding here.
notifications.sendEmail()only accepts plain text content, but YouTrack automatically creates both HTML and plain text versions for you behind the scenes.When you send content like
"<h1>Hello</h1><p>Message with <strong>tags</strong></p>", YouTrack automatically:The recipient's email client then chooses which version to display based on their email client preferences.
You can't manually specify separate HTML and plain text content, as YouTrack automatically converts your input into both formats. For more granular control over both versions or the ability to add email attachments, there's a feature request you might want to follow: JT-69052.
Also, since
notifications.sendEmail()bypasses YouTrack's notification system, it doesn't connect to individual YouTrack user preferences. If you want to respect a specific user's YouTrack notification settings (like their plain text-only preference), you can consider using user.notify() instead.Let me know if you have any other questions!