How to Send a Customized Email when a new file is added using Power Automate?

If you want to send a customized email when a new file is added to the SharePoint list, check out this complete Power Automate tutorial. Here, I have explained how to use the “when a new file is added action” in Power Automate Flow.

Scenario:

Recently I got a requirement to send a customized email when a new file is added to the SharePoint document library. I will show you here two different Examples.

In the first example, I’ll explain how to automatically send a customized email when a file is added to the document library without using any prebuilt template.

In the second example, I will show you how to send a customized email when a file is added to the document library by using the prebuilt template called (Send a customized email when a new file is added).

Before creating a flow, we have to create a SharePoint Online document library. Here, I have created a document library called EmployeeDocuments.

Send a customized email when a new file is added using Power Automate

We will create a flow to send a customized email when a new file is added to the SharePoint document library using Power Automate.

How to Send a customized email when a new file is added using Power Automate

Let us see how to send a customized email when a new file is added using Power Automate flow.

Example -1:(Without Using Prebuilt Template)

In this example, The flow triggers automatically when a new file is added to the SharePoint library, and the user will be notified with a customized email. To achieve this, follow the below steps:

Step-1:

Create an automated cloud flow and choose the trigger “When a file is created (properties only)” for SharePoint from the action trigger.

See also  5 Simple and Powerful Power BI dashboard examples

Expand the trigger action and configure the required parameters:

  • Site Address – From the dropdown, select the SharePoint site address
  • Library Name – Select the SharePoint document library from the dropdown (here, I have selected my Employee Documents Library)
  • Folder – Choose the Folder from the show picker where you want to check whether the file is added.
Send a customized email when a new file is added in Power Automate flow

Step-2:

Select +new step and send an email(v2) action from the action triggers. Pass the required parameters from the dynamic content values.

  • To: Enter the employee email name (email address) from dynamic content
  • Subject: Enter a subject line for Mail (here I have added Document Added Successfully)
  • Body: Enter the body of the email. Then, enable the code view, add HTML code, pass the values from dynamic content, and customize the mail as per requirement.
<p>Hi @{triggerOutputs()?['body/Author/DisplayName']},<br>
<br>
This Mail is to infrom you that your Document called <b> @{triggerOutputs()?['body/{FilenameWithExtension}']} </b>has been added successfully to the SharePoint Document Library.<br>
Please follow the link to verify the document added: <b><a href=' @{triggerOutputs()?['body/{Link}']}'>click here</a></b><br>
<br>
Thanks,<br>
SharePoint Team</p>
Send a customized email when a new file is added

Step-3:

Run the flow. The flow triggers automatically when a new file is added to the SharePoint document library.

Here, I have added a new file called Patti Fernandez in the SharePoint Employee Documents library, as highlighted below:

Send a customized email when a new file is added using flow

Once the flow triggers automatically and runs successfully, A Customized email will be sent to the user in their Outlook.

Send me an email when a new file is added in SharePoint Online library

This is how to Send a customized email when a new file is added using Power Automate flow.

Example -2: (By Using Prebuilt Template)

In this example, I will show you how we can send a customized email when a file is added to the document library by using the prebuilt template called “Send a customized email when a new file is added“.

See also  Power Apps combo box filter

Step-1:

Log in to Power Automate flow using the credentials, and Select Templates from the left navigation.

Then search and choose Send a customized email when a new file is added template provided by Microsoft as highlighted below:

Send a customized email when a new file is added template

Step-2:

  • A new page will appear like the one below with the selected “Send a customized email when a new file is added” template.
  • The flow automatically connects to Office 365 users, office 365 Outlook, and SharePoint. The Green tick mark displays the valid connection. If it is not connected, connect it first.
  • Once the connection is valid, Click on the Continue option.
Send an Outlook Email with Power Automate When a New File is Added to SharePoint Document Library

Step-3:

It creates a flow for us, once the flow has been created. Expand the When a file is created (properties only) trigger. Configure the below Parameters.

  • Site Address – From the dropdown, select the SharePoint site address
  • Library Name – Select the SharePoint document library from the dropdown (here, I have selected my Employee Documents Library)
  • Folder – Choose the Folder from the show picker, where you want to check whether the file is added or not.
Send a customized email when a new file is added in Power Automate flow

In the Get my Profile (V2) action, pass the created by Email from the dynamic content values

Send an Outlook Email When a New File is Added to SharePoint Document Library using Power Automate flow

By default, The Send a customized email when a new file is added provides the send email action with the below details:

Power Automate Send a customized email when a new file is added to SharePoint document library

Step-4:

Run the flow. The flow triggers automatically when a new file is added to the SharePoint document library.

Here, I have added a new file called Alex Wiber in the SharePoint Employee Documents library, as highlighted below:

Send a customized email when a new file is added to SharePoint document library in Power Automate flow

Once the flow triggers automatically and runs successfully, an email with the default mail body is sent to the user.

Send a customized email when a new file is added to SharePoint document library in Power Automate

So, here I am going to change or customize the default mail body with the HTML code given by the Pre-built template as below:

Hi @{outputs('Get_my_profile_(V2)')?['body/givenName']},<br><br>
This Mail is to infrom you that the Document called <b>@{triggerOutputs()?['body/{FilenameWithExtension}']}</b> has been added successfully to the SharePoint Document Library.
Please follow the link to verify the document added: <b><a href ='@{triggerOutputs()?['body/{Link}']}'>click here</a></b><br>
Thanks,<br>
SharePoint Team
Send a customized email when a new file is added to SharePoint document library using Power Automate

Again, I am going to add a new file called Lynne Robbins to the SharePoint document library as shown below:

How to Send a customized email when a new file is added using Power Automate flow

Once the flow triggers automatically and runs successfully, A Customized email will be sent to the user in their Outlook.

How to Send a customized email when a new file is added using Power Automate

This is how to Send a customized email when a new file is added by using the Power Automate Template flow.

See also  Power Apps Navigate Function + 16 Examples

Conclusion

I hope you got an idea of how to Send a customized email when a new file is added to the SharePoint document Library without using any Prebuilt templates.

Similarly, I have shown you how to work and customize the default mail body for the Send a customized email when a new file is added Template flow in Power Automate.

You may also like:

  • >