Hi,
I am using a function get_mail() to return the mail to the assistant api when the visitors asks for it so he can print it. He does that but without any formating. It’s like this “bla bla the email is example@example.com”.
I would like to have a clickable link (mailto:example@example.com) insteadt and I wonder if there is a special trick I need to use.
Or are the **-characters he put before and after exclusivly used for emails? In this case I could replace them before parsing the message.
If you are rendering with a markdown to HTML formatter, you’ll just have to return instructions telling the AI what it should reproduce, and better, send that as your return.
To instruct an AI model to create clickable email links where the displayed link text is the email address itself, you can provide clear instructions like below:
Instructions for Creating Clickable Email Links
-
Markdown Syntax: In Markdown, you create clickable links using the following format:
[link text](mailto:email@domain.com)
Replace
link text
with the email address that you want to be visible. -
Email Link Displaying Email Address: If you want the displayed text to be the email itself, you can do:
[email@domain.com](mailto:email@domain.com)
This way, the email address is both the clickable text and the target.
-
Adding Subject and Body: To include a subject and body in the email link:
[email@domain.com](mailto:email@domain.com?subject=Subject%20Text&body=Body%20text)
- Replace
Subject%20Text
with your desired subject (spaces should be encoded as%20
). - Replace
Body%20text
with the message body text.
- Replace
-
Example Links:
[example@domain.com](mailto:example@domain.com)
[example@domain.com](mailto:example@domain.com?subject=Hello&body=This%20is%20a%20message)
-
Shown here in the forum’s markdown renderer:
By providing instructions like this, the AI model will understand how to generate links where the email address is the visible part and the target for the link.