JSON to draft email and highlight certain text

Ember Krumwied 5 Reputation points
2024-07-24T16:17:13.9633333+00:00

I have an SP List and a column that displays as a hyperlink. When clicked certain information from the current item is added to a new draft outlook email. There are some placeholder fields included in the body of the message that'd we'd like to have highlighted (to bring attention to the items the user should update before sending the email. I'm struggling with how to designate the items we'd like to have highlighted. Below is the full code, the portions we'd like to have highlighted are in bold/italics.

{

"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",

"elmType": "a",

"attributes": {

"class": "sp-field-quickActions",

"href": {

"operator": "+",

"operands": [

"mailto:",

"[$RecruitingContact]",

"?subject=Referral for ",

"[$Company]",

" - ",

"[$Position]",

"&body=I would like to recommend [Enter Name of Candidate] for the ",

"[$Company]",

" - ",

"[$Position]",

" position.",

"\r\n",

"I am attaching their resume and providing a link to their LinkedIn profile. [Edit this sentence if no resume or link will be included.]",

"\r\n",

"[Please enter a brief statement of how you know and/or are related to the candidate.]"

]

}

},

"children": [

{

"elmType": "button",

"txtContent": "Refer a Friend",

"style": {

"background-color": "#E6E6FA",

"color": "#2F4F4F",

"width": "100%",

"font-weight": "bold"

}

}

]

}

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,678 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ling Zhou_MSFT 17,060 Reputation points Microsoft Vendor
    2024-07-25T02:17:48.1666667+00:00

    Hi @Ember Krumwied,

    Thank you for posting in this community.Do you want to modify the font format of body part in the hyperlink and bring it to the draft in Outlook?

    If it is, this is not possible at all.

    As you can see in RFC 2368, this is not possible at all:

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link. 

    The special hname "body" indicates that the associated hvalue is the body of the message. The "body" hname should contain the content for the first text/plain body part of the message. The mailto URL is primarily intended for generation of short text messages that are actually the content of automatic processing (such as "subscribe" messages for mailing lists), not general MIME bodies.

    Mailto can only contain plain text content, and we can't use CSS tags to make the font bold/italics.

    Hope this information helps.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.