Skip to main content

Notifications

Community site session details

Community site session details

Session Id : EDAngxBMBfgsbKuidEa7u8
Power Automate - Building Flows
Unanswered

Using HTML/CSS to create buttons in Send an Email (V2)

Like (0) ShareShare
ReportReport
Posted on 9 Aug 2022 13:03:18 by 93

Hi,

I'm trying to use the Send an Email (V2) function to have the user click on a button in the e-mail that redirects them to a link. 

Ideally I could use Send an Email with Options to do this but it doesn't seem like I can redirect the user to a custom link using that function. 

 

I've tried using this code just to see if I can have buttons in the email but it doesn't work:

 

<!DOCTYPE html>
<html>
<head>
<style>
.button {
 border: none;
 color: white;
 padding: 15px 32px;
 text-align: center;
 text-decoration: none;
 display: inline-block;
 font-size: 16px;
 margin: 4px 2px;
 cursor: pointer;
}

.button1 {background-color: #4CAF50;} /* Green */
.button2 {background-color: #008CBA;} /* Blue */
</style>
</head>
<body>

<h1>The button element - Styled with CSS</h1>
<p>Change the background color of a button with the background-color property:</p>

<button class="button button1">Green</button>
<button class="button button2">Blue</button>

</body>
</html>

 

 

  • v-bofeng-msft Profile Picture
    on 11 Aug 2022 at 05:45:45
    Re: Using HTML/CSS to create buttons in Send an Email (V2)

    Hi @charizard ,

     

    That is not available.

     

    First, Buttons created by this method are not clickable in emails, which is a known limitation of Outlook.

    You might consider using adaptive card instead.

    Second, if you wants to set the buttons' behavior , you should use JS , the could shoud be something like this:

    <!DOCTYPE html>
    <html>
    <head>
    <style>
    .button {
     border: none;
     color: white;
     padding: 15px 32px;
     text-align: center;
     text-decoration: none;
     display: inline-block;
     font-size: 16px;
     margin: 4px 2px;
     cursor: pointer;
    }
    
    .button1 {background-color: #4CAF50;} /* Green */
    .button2 {background-color: #008CBA;} /* Blue */
    </style>
    </head>
    <body>
    
    <h1>The button element - Styled with CSS</h1>
    <p>Change the background color of a button with the background-color property:</p>
    
    <button onclick="OpenGoogle()" class="button button1">Google</button>
    <button onclick="OpenBing()" class="button button2">Bing</button>
    
    <script >
    function OpenGoogle(){window.open('https://www.google.com') };
    function OpenBing(){window.open('https://www.bing.com') };
    
    
    
    </script>
    
    </body>
    </html>

     

    Best Regards,

    Bof

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started
Loading complete