Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

send an email only once through workflow

Posted on by 75

I need to send a reminder email to the opportunity owners if the modified date is greater than 12 months. I have created a workflow with the below condition. I need to send only one reminder on 13th month 1st Day(since I have mentioned the condition as ‘modified on’ on or before 12-current date, a daily email will be triggered to the opportunity owner). Once the email is sent, I have tried to update a field(is email sent ='yes') in the opportunity entity, but since it is system update, 'modified on' date field is getting changed. I do not want 'modified on' date field is getting changed. Is there any way to restrict only one email is being sent to the opportunity owner?

4745.screenshot.jpg

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: send an email only once through workflow

    Hi,

    You can use custom workflow to add check condition before sending an email from workflow. Add new custom field in Email itself say Opportunity Reminder Sent.

    Input variable - Opportunity record

    Output variable - email found bool data type

    Custom workflow c# code will first check if there is any existing Email already present (use custom field in filter condition)in system for the current opportunity record. If record returned from this check is zero then set the output parameter to no else set yes.

    then in workflow check this output parameter and send email if email found(Output parameter from custom workflow) is no.

    If found helpful, Please mark my answer verified.

  • Suggested answer
    ACECORP Profile Picture
    ACECORP 1,579 on at
    RE: send an email only once through workflow

    If it were me, I would create a field on the Opportunity Entity named  "OpportunityReminderSent ".

    Then I would edit the filter on the workflow to include  AND OpportunityReminderSent Does Not Contain Data 

    Then when the workflow runs, it uses the original criteria and the new "OpportunityReminderSent " field to determine Opportunities that do not yet have the "OpportunityReminderSent" populated.

    Your workflow will then send the initial 13 month email reminder and the final step is to update the Opportunity to set the "OpportunityReminderSent" to the date the workflow sent the email.

    Yes the modified on date will now change, but that no longer matters since you are ALSO looking for a blank/null "OpportunityReminderSent" and that won't be blank/null since you are sending the 13 month email for it.

    The fact the modified on date gets updated when a value is written to "OpportunityReminderSent" is no longer a problem. 

    That will ensure the Opportunity is only actioned on with a 13 month reminder email one time. 

  • Jayaa E Profile Picture
    Jayaa E 75 on at
    RE: send an email only once through workflow

    Yes, I can do that. Now the problem is, I cannot update a field in the opportunity entity after email is sent. This is updating my 'modified on'

    date field(which I dont want). So I need alternate solution to send a single email to opportunity owners.

  • scr1pt Profile Picture
    scr1pt 130 on at
    RE: send an email only once through workflow

    Why don't you add "email sent" = no to the condition filter?

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans