web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Email Template Attachment Storage

(0) ShareShare
ReportReport
Posted on by 247

Dynamics 365 CE can anyone tell me where attachments/documents are stored for email templates.  In must cases the attachment is not in the documentbody.

I have a process that creates a merged document by using the filename associated with the email template (works great) but I store the files on Azure (double the work), what I need to happen is to use the actual document attached to the template, but I do not know where the document is stored.

I have the same question (0)
  • Verified answer
    LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    The attachment in email templates are stored in Attachment Entity in D365.

    And the only way to retrieve it is accessing to "ActivityMimeAttachment" entity reference by webapi or C#.

    Here's a sample code about how to get attachment in email template by C#.

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/sample-retrieve-email-attachments-email-template

    From the sample code below, we could see how to get attachments in template.

    pastedimage1588042634609v1.png

    https://github.com/microsoft/PowerApps-Samples/blob/master/cds/orgsvc/C%23/RetrieveEmailAttach/RetrieveEmailAttach/SampleProgram.cs

    Here's the details for "ActivityMimeAttachment" entity reference.

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/entities/activitymimeattachment

    We could also call webapi to get data we need from it.

    pastedimage1588042689814v2.png

    Hope it helps.

    Best Regards,

    Leo

  • IwishIknow Profile Picture
    247 on at

    Leo,

    Thank you for taking the time to respond to my question.  I to beleived that the attacment shouls be in the ActivityMemeAttachment entity in the "body" field using fetchxml I tried ever combination you could think of but the body field was always blank.  Well at least I thought the field was blank after your response I try one more time and the field looks empty.  Then I decided to select the field and copy it and guess what it has data.

    Long story longer the PDF is in the   ActivityMemeAttachment  entity.

  • LeoAlt Profile Picture
    16,331 Moderator on at

    Hi partner,

    Glad to hear that and thanks for your sharing :)

    Best Regards,

    Leo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 22 Super User 2026 Season 1

#1
Suriyanarayanan V Profile Picture

Suriyanarayanan V 22

#3
Encore Business Solutions Profile Picture

Encore Business Sol... 14

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans