Skip to main content

Notifications

Community site session details

Community site session details

Session Id : tms7YbR5V+KkD5LpWSUTff
Power Automate - Building Flows
Unanswered

Issue in displaying background image in power automate

Like (0) ShareShare
ReportReport
Posted on 27 Jan 2025 16:42:02 by
 
Hi All , 
 
i am trying to send congratulation email via power automate , issue is with setting image as background in email , Steps in flow:

1) i have image copied on my Onedrive and am using get file content to locate image 
2) post that compose function using datauri
dataUri(outputs('Get_file_content')?['body']) 
3) Initialize variable = V_Image
concat('<img src="',outputs('Compose'), '" alt="Super" />')

4) Send an email (V2) and in mail body using HTML printing V_Image . 
 
I am getting email with image stored, however my requirement is to have this image set as background image for entire page in outlook and i can write congratulations message inside the image.

 
Regards
 
 
 
 
 
  • Suggested answer
    Mark Nanneman Profile Picture
    989 Super User 2025 Season 1 on 29 Jan 2025 at 14:38:40
    Issue in displaying background image in power automate
    Hello,
     
    Try using this HTML template in your "Send an email (V2)"

    Just update the "background-image: url()" property to your image.

    Please note, datauri encoded images might not work on other email platforms like Gmail.  I get them to work in Outlook but Gmail just removes an image stored inline.  If you use a publicly hosted image file url then it works fine for me.


    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Background Image Email</title>
    </head>
    <body style="margin: 0; padding: 0;">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" style="background-image: url( '<data_uri_OR_url_to_image_file>' ); background-size: cover; background-repeat: no-repeat; background-position: center; min-height: 100vh;">
            <tr>
                <td align="center" style="padding: 20px;">
                    <div style="max-width: 600px; background: rgba(255,255,255,0.8); padding: 20px;">
                        <h1>Welcome!</h1>
                        <p>This email has a background image behind the text.</p>
                    </div>
                </td>
            </tr>
        </table>
    </body>
    </html>


    Here's a blog post in more detail on how to do this:
    https://marknanneman.wordpress.com/2025/01/28/how-to-send-an-email-with-a-background-image-in-power-automate/


    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!

    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff  


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!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 14

#2
Churchy Profile Picture

Churchy 12

#3
rzaneti Profile Picture

rzaneti 10 Super User 2025 Season 1

Overall leaderboard