cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

sending an email to multiple users

Hi all
I was helped out by the community on this question:
https://powerusers.microsoft.com/t5/Building-Power-Apps/sending-an-email-to-multiple-users/m-p/63567...

 

Where i needed email 5 users that were only referenced in a table on App OnStart, and it works great when i'm patching the record, how do I change the suggestion when i'm not patching, but writing to an existing record via this code:

 

Office365Outlook.SendEmailV2(Form1_9.LastSubmit.IssuedTo.Email, "extension granted by : " & CurrentUser.FullName & " Ref number: " & DataCardValue34_5.Text, " Please review <br> <a href='https://apps.powerapps.com/play/00000&PD=" & Form1_9.LastSubmit.ID & "'> You can review and action the request here </a> "

& "<br><br> Kind regards, <br>

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: sending an email to multiple users

@Lefty ,

Why are you referring to Form9.LastSubmit() at the top when you have already set the To email address at App OnStart? You need it to do the Deep Linked ID, but that is all.

Office365Outlook.SendEmailV2(
   Concat(
      MyApprovers, 
      MyUser & 
      ";"
   ), 
   "User has accepted, " The user : " & 
   CurrentUser.FullName & 
   " has  accepted Ref number: " & 
   DataCardValue4.Text & 
   "<br> <a href='https://apps.powerapps.com/play/000000&PD=" & 
   Form1_9.LastSubmit.ID & 
   "'> You can review here </a> " & "<br><br> Kind regards, Email",
   {Cc:CurrentUser.Email, Importance:"Normal"}
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

6 REPLIES 6
Highlighted
Impactful Individual
Impactful Individual

Re: sending an email to multiple users

can you rephrase this pls?

Highlighted
Post Prodigy
Post Prodigy

Re: sending an email to multiple users

Hi 

 

I would like to email 5 users 

The problem is I don't have a field with the 5 users but I have on my App OnStart a table:

 

Set(MyApprovers, 
Table({MyUser: "Email1.uk"},
     {MyUser: "Email2.uk"},
     {MyUser: "Email3.uk"},
     {MyUser: "Email4.uk"},
     {MyUser: "Email5.uk"}
));

 

 The suggestion @ 

Highlighted
Super User
Super User

Re: sending an email to multiple users

Hi @Lefty ,

Your To: field would be

Concat(MyApprovers, MyUser & "; ")

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Highlighted
Post Prodigy
Post Prodigy

Re: sending an email to multiple users

@WarrenBelz 

Afraid that doesn't work for this scenario, but did work based on the answer provided in my other question by @v-xida-msft where they suggested using the Concat(MyApprovers, MyUser & ";"
as you can see I am using that in the first part of my form.

UpdateContext(
	{
	VarPatchedRecord:
	Patch(
		ListName, Defaults(ListName),
		Form1_2.Updates,
                Form1_6.Updates,
		Form1_7.Updates
        
    ) 
	}
);
If(Not(IsBlank(VarPatchedRecord.ID)),Navigate(SuccessScreen);

Office365Outlook.SendEmailV2(Concat(MyApprovers,MyUser & ";"),
"An application has been submitted by  " & DataCardValue8.Selected.DisplayName, " Please review the application <br>  <a href='https://apps.powerapps.com/play/0000&PD=" & VarPatchedRecord.ID & "'> You can review and action the request here </a> "
 & "<br><br> Kind regards, <br>

<br>Team name here
<br><b>Team name here</b> 
<br>Add here 
<br>
Email here"

,{Cc:DataCardValue8.Selected.Email & ";" & DataCardValue10.Selected.Email, Importance:"Normal"}))

 

The problem I have is I don't quiet know how to alter the code when I am not patching, but updating an already submitted record via this code which is on my OnSuccess property of Form1_9.

I have put in the same concat code here but getting errors and not sure how exactly I change this to work the same as the first screen:

Office365Outlook.SendEmailV2(Form1_9.LastSubmit(Concat(MyApprovers, MyUser & ";"), "User has accepted, " The user : " & CurrentUser.FullName & " has  accepted Ref number: " & DataCardValue4.Text & "<br> <a href='https://apps.powerapps.com/play/000000&PD=" & Form1_9.LastSubmit.ID & "'> You can review here </a> "

& "<br><br> Kind regards, 
Email",{Cc:CurrentUser.Email, Importance:"Normal"});

Hovering over the red line, which is o nthe entire code, starting from (Form1_9 i get :

'Invocation of unknown supported or unsupported function'

 

Highlighted
Super User
Super User

Re: sending an email to multiple users

@Lefty ,

Why are you referring to Form9.LastSubmit() at the top when you have already set the To email address at App OnStart? You need it to do the Deep Linked ID, but that is all.

Office365Outlook.SendEmailV2(
   Concat(
      MyApprovers, 
      MyUser & 
      ";"
   ), 
   "User has accepted, " The user : " & 
   CurrentUser.FullName & 
   " has  accepted Ref number: " & 
   DataCardValue4.Text & 
   "<br> <a href='https://apps.powerapps.com/play/000000&PD=" & 
   Form1_9.LastSubmit.ID & 
   "'> You can review here </a> " & "<br><br> Kind regards, Email",
   {Cc:CurrentUser.Email, Importance:"Normal"}
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

Highlighted
Super User
Super User

Re: sending an email to multiple users

Hi @Lefty ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,664)