All,
I have tried this a couple ways and I'm not having any luck. I have a NewForm to add to a datasource in a SharePoint list with attachments. I also need to be able to send this data as an email without using a flow and without using the Outlook connector. So what I need is when the form submit button is pressed I also need it to do the following, Mail.SendEmailV3("emailaddress","subject",HtmlText1.HtmlText,true,{filenames:attachmentname,files:attachment}) but I can't get the attachment part to work.
Any help is greatly appreciated.
When I put this in my form(Form2) it gives me an error.
Mail.SendEmailV3("email@email.com",
DataCardValue21.Text,
HtmlText1.HtmlText,
true,
{
files:First(Form2.LastSubmit.Attachments).Value,
filenames:First(Form2.LastSubmit.Attachments).DisplayName
}
)
Both the Files and Filenames have errors, the filenames says its expecting text but using an Error type. Same for the files, expecting Blob and using Error type.
The attachment data card uses an IF to make it required based on another data card if that might be causing it.
Any ideas on this?
Hi @StephenGW
You might be interested in my blog post here, which describes the syntax that @Ramole mentions and explains how to use the Mail connector in more detail.
http://powerappsguide.com/blog/post/when-and-how-to-use-mail-connector
In your case, since you want to send your message on the submission of a new record, you would add the following formula to the OnSuccess property of your form. LastSubmit.Attachments provides access to the attachments.
Mail.SendEmailV3("tim@emailaddress.com",
"New record - Files",
HtmlText1.HtmlText,
true,
{
files:First(Form1.LastSubmit.Attachments).Value,
filenames:First(Form1.LastSubmit.Attachments).DisplayName
}
)
Hi @StephenGW
Sorry I never used Mail connector but try this please
Mail.SendEmailV3("Name@microsoft.com",
"Enter the email title here",
"Enter your email message here",
false,
{
files:First(ThisItem.Attachments).Value,
filenames:First(ThisItem.Attachments).DisplayName
}
)
I could not get this to work with the Mail connector as I stated I cannot use the Outlook connector. Do you know how to do this with the Mail connector?
As mentioned in my post I would like to avoid using Flow. I need the email to be fully translatable into other languages and the best way I found to do that is to build the email in HTML in the app. Also I need every entry in the app form to go to the SharePoint list but only some conditions will send an email.
Hi @StephenGW
Office365Outlook.SendEmailV2(
"Name@emicrosoft.com",
"Email Subject",
"Email Body",
{
Attachments: RenameColumns(
ThisItem.Attachments,
"Value",
"ContentBytes",
"DisplayName",
"Name"
),
Importance: "Normal"
}
)