Hi Experts,
This is my first attempt at a powerapps and i'm amazed i've done as much as I have so far, there's one thing I can't seem to get to work. I'm trying to email the signature and the attachments that are uploaded on the powerapp. I've added the below code but it only sends through the signature and not the attachments. Can you tell me where i'm going wrong please?
Office365Outlook.SendEmailV2("firstname.lastname@mydomainname.com", "Subject Here", "Body Here",{Attachments: AddColumns( RenameColumns (AttachmentControl.Attachments,"Value", "ContentBytes"), "@odata.type", "")};
{Attachments:Table({Name:"Drawings.jpg", ContentBytes:Signature.Image , '@odata.type':""})});Reset(AttachmentControl);Reset(Signature)
Thanks in advance!
Hi @DublinOH_User ,
You need two attachment controls - one for each purpose.
When I try this approach the attachment property in the email formula - states there are mixed content types. Meaning the column with the image blog in the collection (ContentBytes:) cannot accept different file types.
So the image in the email body formats fine - but I cannot seem to be able to add additional regular attachments (pdf, excel, etc.)
Any ideas???
Thank you for your help with this, I can confirm that this has worked. Much appreciated and apologies in the delayed response.
Hi @Dave-ITMan ,
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.
Visit my blog Practical Power Apps
Hi @Dave-ITMan ,
Try the below
ClearCollect(
colImages,
AddColumns(
RenameColumns(
AttachmentControl.Attachments,
"Value",
"ContentBytes"
),
"@odata.type",
""
),
{
Name: "Drawings.jpg",
ContentBytes: Signature.Image
}
);
Office365Outlook.SendEmailV2(
"firstname.lastname@mydomainname.com",
"Subject Here",
"Body Here",
{Attachments: colImages}
);
Reset(AttachmentControl);
Reset(Signature)
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.
Visit my blog Practical Power Apps
Thank you for the quick reply. I'm trying to avoid using flow if it's possible as I prefer to just troubleshoot via one system if that makes sense. I can't imagine it would be difficult to do via code, as i'm halfway there, it's just the final stage that's really frustrating.
My suggestion is for you to use the Flow to send the email.. It might be easier.
Here you have a flow that uses the signature in a PDF
https://www.youtube.com/watch?v=EACk5jlQ_jU
If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!
Best regards,
Gonçalo Nogueira
Check my LinkedIn!
Check my User Group (pt-PT)!
Last Post on Community
My website!