Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Answered

Email Template Attachment Storage

Posted on by 245

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.

  • LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Email Template Attachment Storage

    Hi partner,

    Glad to hear that and thanks for your sharing :)

    Best Regards,

    Leo

  • IwishIknow Profile Picture
    IwishIknow 245 on at
    RE: Email Template Attachment Storage

    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.

  • Verified answer
    LeoAlt Profile Picture
    LeoAlt 16,329 on at
    RE: Email Template Attachment Storage

    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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans