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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

How to send scheduled e-mail

(0) ShareShare
ReportReport
Posted on by 245

I have a requirement to queue and only send emails between 8PM to 12MN. 

Any recommendations how to implement this out of the box?

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at
    RE: How to send scheduled e-mail

    Hi Benjamin,

    You can create out of box workflow as recursive workflow to send email on scheduled time.

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: How to send scheduled e-mail

    Hi

    You have a few options to achieve this, the first one I would suggest is to try setting the DelayedEmailSendTime. As soon as an email is created, using a real-time workflow or plugin you should be able to set this filed to have datetime after 8 PM.

    docs.microsoft.com/.../email

    For this approach, you do not need to queue email items, email will be sent at the delayed time set.

  • Benjamin Fallar III Profile Picture
    245 on at
    RE: How to send scheduled e-mail

    Do you have an example? Isn't recursive workflow is not recommended? Please elaborate.

  • Benjamin Fallar III Profile Picture
    245 on at
    RE: How to send scheduled e-mail

    Do you have example on how to implement the DelayedEmailSendTime. Do I need to write plugin for this?

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: How to send scheduled e-mail

    Hi Benjamin

    Send email delayed is a feature introduced as part of the Email Engagement - Embedded Intelligence

    "Write your messages when it's convenient for you, but schedule delivery for when they're most likely to be noticed and read by recipients. The system even checks recipients' time zones to provide advice about when the best delivery times might be."

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/sales-enterprise/embedded-intelligence

    You can enable email engagement as shown below.

    ScreenClip-_5B00_561_5D00_.png

    Once you have enabled email engagement, you can train the users to set the email delivery time from the UI. This would require no additional custom work as its already built-in

    ScreenClip-_5B00_561_5D00_.png

    If training users to use this feature is not appropriate for your requirement, and If you would like to automate this using workflow instead of training users, you could create a CWA to set this datetime value and call that in a real-time workflow that triggers On Create of the Email or you could write a plugin as well.

    The following snippet is to update the email delivery time

    Entity ent = new Entity("email", new Guid("EED965BE-D468-E911-A97B-0022480187F0")); 
    ent[
    "delayedemailsendtime"] = DateTime.Now.Date.AddHours(20); // This is to sett he time to be 8PM on the same day you can change this
    Service.Update(ent);

    Note: If you have not Enabled Email engagement, you will get the following error when you try to update the above field value

    "An error has occurred: We can’t update the delay send time because Email Engagement isn’t turned on for the organization."

    Hope this helps

  • Benjamin Fallar III Profile Picture
    245 on at
    RE: How to send scheduled e-mail

    Again, we need this in our workflow. Not using AI.

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: How to send scheduled e-mail

    Hi

    As I suggested in the post above, you could create a CWA to set this datetime value and call that in a real-time workflow that triggers On Create of the Email or you could write a plugin as well to do the same.

    If you do not want to take advantage of this feature, you could certainly think about the following options

    Option 1 :

    Create a child workflow that waits until 8pm and sends an email - For sending an exiting email, you could create a CWA to send an email or use workflow tools. Create another workflow, real-time one, that triggers On Before Status change of email, checks the time and if the time is not between 8PM - 12MN, change the status back to draft and starts a waiting workflow (above-mentioned child workflow) to send the email on or after 8PM.

    Option 1:

    Create a real-time workflow that triggers On before status change of email and checks the time and if its not within 8PM-12MN, moves the email to a queue.

    Create a scheduled Azure Function / Flow / Workflow that runs daily after 8PM and goes through a list of all the emails on the queue and sends them.

  • Benjamin Fallar III Profile Picture
    245 on at
    RE: How to send scheduled e-mail

    No plugins.

    That's the tricky in workflow, how do you check the time in between 8pm and 12mn.

  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: How to send scheduled e-mail

    Have a look at the following CWA example, you could create similar CWA that returns the Hour of the given datetime.

    github.com/.../Split.cs

    If the hour is returned by the CWA  is in 24 hr format,  you can then have the condition in your workflow to make sure its between 20 and 0.

  • Suggested answer
    Dynamics Objects 365 Profile Picture
    550 on at
    RE: How to send scheduled e-mail

    Hi Benjamin,

    You can use Microsoft Flow to achieve this.

    It is totally no code solution.

    You have to create a Scheduled Microsoft Flow.

    [View:https://flow.microsoft.com]

    Please provide feedback if it helps you.

    Cheers !!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#3
SC-08081331-0 Profile Picture

SC-08081331-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans