cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lefty
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

@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
cds
Impactful Individual
Impactful Individual

can you rephrase this pls?

Lefty
Post Prodigy
Post Prodigy

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 @ 

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.

 

@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'

 

@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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (45,893)