Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

(0) ShareShare
ReportReport
Posted on by 594

Hello CRM World,

I am facing peculiar issue. I have a plugin registered on send email message which works fine when i manually send an email from Dynamics CRM. I also have OOB asynchronous workflow which will send email. But my plugin doesn't get triggered when this email is sent from workflow.

This is really complicating my business scenario. Can anyone help me out on how to trigger the plugin when i send email from OOB asynchronous workflow?

*This post is locked for comments

  • Verified answer
    chakkay Profile Picture
    594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Resolved the issue. Changes the Plugin message from "send" to "create" and now my background workflow sending email is triggering the plugin.

    I wrote trace and increased the depth to more than 2 but still not working. The basic flaw is that if we register a plugin on "Send" message only button click of reply will trigger this plugin and background email send wont trigger the plugin. That might be the reason why i dont see any trace logs even though i completely filled my code with traces.

    THANKS YOU ALL FOR RESPONDING

  • Verified answer
    Aric Levin - MVP Profile Picture
    30,188 Moderator on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Are there any errors in the Plugin trace log that can help us out?

    Also, can you add tracing in different places in your plugin so that it output where the error might be?

  • Verified answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Hi ,

    Is there any context  depth check having  in your plugin code , could you please increase make it maximum 2 instead of 1 and try once.

    I am saying as may be it's returning from the first line of plugin.

  • chakkay Profile Picture
    594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Sorry i cant share any code or screenshot as it is company security policy.

    Again explaining the whole scenario:

    I have written a Synchronous plugin on post stage which fires on Send message and do some action.

    But when i send an email from OOB asynchronous/synchronous workflow the plugin is not getting fired. Why?

  • chakkay Profile Picture
    594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Hi Wei,

    I double checked the workflow. It looks fine for me.

    I tried registering my plugin on create message and plugin even got fired when i send an email through background workflow. But as part of create message, you will get email Entity as input parameter. The sad thing is email hasent been created yet in system and i dont know how i am getting an email GUID. When i try to service.update(_email) or service.create(_email) it throws error saying there is no such record existing

    CRM Behaving weird!!!!!!!

  • chakkay Profile Picture
    594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Hi Goutam,

    I did not get any error. I checked in Plugin trace log and i did not find any log saying my plugin on "Send" message executed. I am on D365 cloud so there is no way i can touch or reset IIS server.

  • rath.amit38@gmail.com Profile Picture
    2 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Hi,

    Can you share your code or the screen shot of it so that the scenario can be analysed?

    Thanks

    Amit Kumar Rath

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    33,626 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Hi,

    double check your workflow, the action for email is under create or send?

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Hi ,

    Did you get any exception or error ? Can you please check in audit log what exactly is happening?

    Also when you changed the plugin Asynchronous  after making change did you reset  IIS?

    Please reset asynchronous process and IIS and try once.

  • chakkay Profile Picture
    594 on at
    RE: Will Plug-In ever get triggered on email send event when i send am email from OOB Asynchronous workflow?

    Aric,

    Just now tried. I changed my plugin from synchronous to asynchronous and ran OOB workflows as asynchronous (as it was before). But still its not working. I am unable to see a log in Plugin trace log.

    Any more suggestions?

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans