cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
8BitWarrior
Advocate III
Advocate III

What is the syntax for the SendMailWithOptions operation in PowerApps (Office365Outlook Connector)?

I am trying to use the SendMailWithOptions operation in PowerApps and I cannot find any resource that explains what the actual syntax is. What is the syntax?

This resource is severely lacking in useful information:
https://docs.microsoft.com/en-us/connectors/office365/#send-email-with-options


2 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Super User III
Super User III

@8BitWarrior 

See my example below.

 

Office365Outlook(
    "johndoe@xyzcompany.com",
    {
        Subject: "This Is My Options Email Title"
        Body: "This is the message you want to send",
        Options: "Option1,Option2,Option3"
    )
)

 

Here's the original documentation.  The required arguments always get passed in order (when there are multiple) and the optional argument are passed in a JSON.

 

Untitled.png

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@mdevaney   - Thanks for that! It helped me down the right path.

For anyone else looking at this post - this is the minimum amount of required information in order to get this operation to work:

Office365Outlook.SendMailWithOptions(
   "https://www.google.ca",
     {
         To:"johndoe@domain.ca",
         Subject: "This Is My Options Email Title",
         Options: "Option1,Option2,Option3",
         HeaderText:"Header Text",
         SelectionText:"Selection text",
         Body: "This is the message you want to send",
         Importance:"Low",
         Attachments:Blank(),
         UseOnlyHTMLMessage:true
      }
)

Still not sure what the purpose of the "NotificationURL" is but you cannot send this message without it


Email Body Output:

 
 
 

View solution in original post

4 REPLIES 4
mdevaney
Super User III
Super User III

@8BitWarrior 

See my example below.

 

Office365Outlook(
    "johndoe@xyzcompany.com",
    {
        Subject: "This Is My Options Email Title"
        Body: "This is the message you want to send",
        Options: "Option1,Option2,Option3"
    )
)

 

Here's the original documentation.  The required arguments always get passed in order (when there are multiple) and the optional argument are passed in a JSON.

 

Untitled.png

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

@mdevaney   - Thanks for that! It helped me down the right path.

For anyone else looking at this post - this is the minimum amount of required information in order to get this operation to work:

Office365Outlook.SendMailWithOptions(
   "https://www.google.ca",
     {
         To:"johndoe@domain.ca",
         Subject: "This Is My Options Email Title",
         Options: "Option1,Option2,Option3",
         HeaderText:"Header Text",
         SelectionText:"Selection text",
         Body: "This is the message you want to send",
         Importance:"Low",
         Attachments:Blank(),
         UseOnlyHTMLMessage:true
      }
)

Still not sure what the purpose of the "NotificationURL" is but you cannot send this message without it


Email Body Output:

 
 
 

View solution in original post

Not sure why the image did save in the post. Here is the output example:

 

SendEmailWithOptions_Output_HTMLtrue.png

You can add hidden values into your options, using hidden input HTML tags:

Options: "Approve all<input type=""hidden"" groupname="""& SelectedItem.GroupName &""" approver="SelectedItem.Approver" action=""MBA"">,Reject all<input type=""hidden"" groupname="""& SelectedItem.GroupName &""" approver="&SelectedItem.Approver &" action=""MBR"">"

Secondly, NotificationURL is used to capture the chosen action in the Power Automate. Create a flow with "When HTTP request is received", process the body and add the final action "Response" to display a confirmation to email recipient after he clicks the option button:

{
  "SelectedOption": "Approve all<input type=\"hidden\" groupname=\"SomeGrouppedTasks\" approver=\"*******@*****.com\" action=\"MBA\">"
}

 

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

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

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (24,050)