cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

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
Highlighted
Super User
Super User

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

@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

Highlighted
Advocate II
Advocate II

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

@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
Highlighted
Super User
Super User

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

@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

Highlighted
Advocate II
Advocate II

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

@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

Highlighted
Advocate II
Advocate II

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

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

 

SendEmailWithOptions_Output_HTMLtrue.png

Highlighted
Frequent Visitor

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

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

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

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,086)