cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dave-ITMan
Frequent Visitor

Attach a Signature and Attachments collection in one email

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! 

1 ACCEPTED SOLUTION

Accepted Solutions

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

 

 

View solution in original post

7 REPLIES 7
Nogueira1306
Super User
Super User

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!

Hi @Nogueira1306 

 

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.

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

 

 

WarrenBelz
Super User
Super User

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

Thank you for your help with this, I can confirm that this has worked. Much appreciated and apologies in the delayed response. 

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???

Hi @DublinOH_User ,

You need two attachment controls - one for each purpose.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (4,122)