Parker Software Ltd Homepage
Forum Home Forum Home > ThinkAutomation Business Process Automation > General
  New Posts New Posts RSS Feed - Deleting an email from Message Store
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Deleting an email from Message Store

 Post Reply Post Reply Page  12>
Author
Message
ajay2799 View Drop Down
New User
New User


Joined: 11 Feb 2018
Location: Redmond
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ajay2799 Quote  Post ReplyReply Direct Link To This Post Topic: Deleting an email from Message Store
    Posted: 11 Feb 2018 at 3:18pm
Hello 

My use case is to delete an email from MessageStore as soon as it has been processed. What would be the best way to do this? Any help would be much appreciated
I have tried Email2DBDeleteEmailFromServer = True in an Email2DB Script but it doesn't seem to remove the email from MessageStore.

Thanks
Ajay
Back to Top
ajay2799 View Drop Down
New User
New User


Joined: 11 Feb 2018
Location: Redmond
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ajay2799 Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 2018 at 3:20pm
Jus to clarify, I do not want this to happen for all messages. Hence a delete all sort of functionality is not what I am looking for. I want to delete a few select emails only when a condition is met.
Back to Top
parkersoft-jim View Drop Down
Admin Group
Admin Group
Avatar

Joined: 11 Nov 2016
Location: Terra
Points: 121
Post Options Post Options   Thanks (0) Thanks(0)   Quote parkersoft-jim Quote  Post ReplyReply Direct Link To This Post Posted: 11 Feb 2018 at 8:42pm
Hi Ajay,

Are you using the built-in database or are you hosting the messagestore database on an SQL server?
Back to Top
ajay2799 View Drop Down
New User
New User


Joined: 11 Feb 2018
Location: Redmond
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote ajay2799 Quote  Post ReplyReply Direct Link To This Post Posted: 12 Feb 2018 at 12:08pm
Hey Jim - Hosting it in SQL Server.


Back to Top
parkersoft-jim View Drop Down
Admin Group
Admin Group
Avatar

Joined: 11 Nov 2016
Location: Terra
Points: 121
Post Options Post Options   Thanks (0) Thanks(0)   Quote parkersoft-jim Quote  Post ReplyReply Direct Link To This Post Posted: 13 Feb 2018 at 7:08am
Hi Ajay,

You could do this two ways,

1. By configuring the Account Settings so that it will Delete Messages From The Message Store After 0 Days.

http://www.thinkautomation.com/help/creating_an_email_account.htm


2. Setup a second account to connect to your ThinkAutomation MessageStore database and use a trigger action to look on the MessageStore table.
Then use a trigger action to perform a query on that table to delete records where the Processed Date is prior to the current date.
Back to Top
mgogoi View Drop Down
New User
New User


Joined: 14 Feb 2018
Location: Bothell, WA
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgogoi Quote  Post ReplyReply Direct Link To This Post Posted: 14 Feb 2018 at 3:42pm
Hello,

I work with Ajay, and was hoping to get some more clarification on your two solutions.

Just to reiterate, we'd want to delete from Message Store immediately if it is sent to a certain email address, and the rest we'd want to keep it for a while. Is there a better way to do this cleanup? I tried using SQL Triggers, but it won't delete the row from the Message Store table. Are there some kind of locks that is preventing a delete?

Thanks,
Mridul
Back to Top
paul.oconnor View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 Dec 2015
Location: US
Points: 27
Post Options Post Options   Thanks (0) Thanks(0)   Quote paul.oconnor Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2018 at 10:45am
Hello Mridul,

The first solution might not be a viable option for you in this instance as you are looking to remove specific records from the messages store. This option is a remove all at the end of the day during ThinkAutomation nightly maintenance.

The second option will be the route you will take. However the record cannot be removed until the message processor has completed all task ( triggers). Therefore, per my colleague suggestion to create a second account that will query the database for that record to be removed. Please let us know if you have any further questions.

Regards,
Paul
Back to Top
mgogoi View Drop Down
New User
New User


Joined: 14 Feb 2018
Location: Bothell, WA
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgogoi Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2018 at 11:31am
Hello Paul,

Is there a way to find out when the message processor is done with all the trigger actions? This will help us to know when to actually delete the row from MessageStore.

Now to explore the 2nd option, I am not sure I understand fully how the 2nd account should be configured. Can you please be a little more explicit?

Thanks,
Mridul
Back to Top
parkersoft-jim View Drop Down
Admin Group
Admin Group
Avatar

Joined: 11 Nov 2016
Location: Terra
Points: 121
Post Options Post Options   Thanks (0) Thanks(0)   Quote parkersoft-jim Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2018 at 12:41pm
You can't really identify when the trigger has finished processing, inside a trigger action, until the actual message has finished processing.

The only way to clear processed messages is to have a second trigger audto running and use a trigger action in your second trigger to delete records from the MEssageStore table.

Hence, my earlier suggestion of just setting at the account level not to store messages at all.

http://www.thinkautomation.com/help/creating_an_email_account.htm
Back to Top
mgogoi View Drop Down
New User
New User


Joined: 14 Feb 2018
Location: Bothell, WA
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgogoi Quote  Post ReplyReply Direct Link To This Post Posted: 15 Feb 2018 at 2:16pm
Hi,

Not to store the messages is not an option. So, ruling that out.

Creating a second account would need to pull the emails from an SMTP server, which would be duplicating the effort of the first account. Is that what you meant?

Thanks,
Mridul


Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.05
Copyright ©2001-2016 Web Wiz Ltd.

This page was generated in 0.053 seconds.