Logic apps against EOL Shared MBx - exchange-server

I am VERY new to Azure Logic apps. Please be gentle - but any links to sources of learning will be appreciated as well.
I have a made a simple logic app at the request of the business that answers every e-mail received in a shared mailbox with an autoreply - instead of the standard "one per customer" action of the normal Exchange Online autoresponder.That part works just fine.
We now need to add an action that can delete without replying for specific senders. Why? We "found" another org that must be set up to do the same thing, thus causing a flood of responses between the two org's Autoresponders. Not surprising, but obviously not good.
I'd like to be able to add the relevant address (and be able to add addresses in the future) to a (parallel?) filter, that would prevent this loop from happening. I've tried my best to use the "Delete Email (V2)" built in function for "Office 365 Outlook" but it always ends in a "Resource Not Found (status code: 400)" error and the email isn't deleted/moved to the deleted items folder.
Any ideas how to either get this to work, or a better way to do this job?
Thanks,
Mule

I have a made a simple logic app at the request of the business that answers every e-mail received in a shared mailbox with an autoreply - instead of the standard "one per customer" action of the normal Exchange Online autoresponder.That part works just fine.
As mentioned in this statement, we understood that you are using When a new email arrives (V3) trigger to give an auto reply.
I've tried my best to use the "Delete Email (V2)" built in function for "Office 365 Outlook" but it always ends in a "Resource Not Found (status code: 400)" error and the email isn't deleted/moved to the deleted items folder.
To make this work you just need to give the message id from the trigger When a new email arrives (V3) and so it deletes the one that has already arrived. You can make required actions in between before deleting the mail.
Considering this to be my logic app
I could able to get the email content to my logic app from outlook in Get email (V2) step and as soon as it completes this action the Delete email (V2) executes and deletes the one that just arrived.
Here is the email that I'm receiving
and the successful run for my logic app
For more information on logic apps you can refer Introduction to Azure Logic Apps - Learn and Azure Logic Apps documentation
REFERENCES:
Office 365 Outlook - Connectors

Ultimately a better answer was to use different variable for the conditional. Using an OR conditional with several archetypical subject lines, as well as embedding "invisible text" in the body of the original response email was the solution, as Logic Apps seems incapable of pulling the Message ID through the steps.
Thanks for your help #swerhakandikonda.

Related

How to create a WorkItem in Azure DevOps based off new email in Shared Inbox, but replies to emails stay within same task

I'm currently trying to set up a workflow within Microsoft Power Automate to do the following:
If an email is sent to a shared email box create a new task in DevOps
If someone replies back to that initial email - any responses to that thread will be tracked in the original task, and no additional tasks will be created from that chain.
Right now I'm leveraging the template that Microsoft provides called "Create a workitem in Azure DevOps when new email arrives in shared mailbox", but it creates additional tasks anytime someone replies back to the thread.
Anyone have suggestions?
Thanks,
You could use a condition that checks the 'Conversation Id' then if it matches an Id from a previously sent email's Conversation Id it does nothing. If it is new, then you'll get a new task.
If you are archiving handled emails, you'll need to filter results from the archival folder.
Here it is mapped out with a SharePoint list mapping the Conversation Id from each email:
Once the details are logged, the Get Items action on the SharePoint list pulls all items. However in that pull it uses an ODATA Filter on:
conversationId eq '<Conversation Id from trigger>'
Then if the number of matches is more than the one that you've just registered in the list, that means it was a response and the flow will follow the "no" branch. However, if it is the only entry, a new work item can be made.
You can make this much more complicated, dependent on requirements, in many areas, as that why you are using Power Automate. For example you could make API (Graph) calls to get Shared Box emails, but this is simpler, and works on a free flow plan until they add a "Get Emails from a Shared Mailbox" connector.
It's not picture perfect, because it doesn't handle a changed subject line, but it does do the job required.

Logic Apps Email Trigger - Get original Alias

Found a very similar question here: Email aliases not returned as "To" address in logic app
TLDR: From within a logic app "When a new email arrives" trigger, How do I get the original alias that the email was sent to?
I have a logic app that creates a ticket based off an email sent to an outlook box. Now I want to be able to choose aspects of the ticket based off of whether or not the email was sent to the mailbox itself or an alias of the mailbox. The problem I'm having is that by the time logic apps gets a hold of the email, the alias address has already been replaced with the actual box's address ("alias1#place.com" -> "actualbox#place.com").
The actual mail in the inbox has the original email's alias information in the headers, but I can only get them by looking at the properties in outlook. I've tried to get the original "To" internetheader information both within logic apps (by exporting the email to blob storage and looking at headers there) and with the Microsoft Graph API. Sadly, the email exported by logic apps doesn't have the alias information and Graph API has pretty much every header but "To". At least one other person has lamented the lack of To
That said, the actual email still has the original alias information. Can someone help me get that information in logic apps without jumping through too many hoops? A many hoop solution is welcome if none other can be found though.
Use the Export email (V2) action from the Office 365 Outlook connector. This will give you the full message with original headers (including the actual To address)!
The flow here is, trigger on the incoming email, as you already are, then add the export email action providing the message id from that trigger to pull this specific email.
From there, you you'll have one big "body" property which you'll need to interrogate to find the To address.
Caveat on this though, it doesn't work when emails are sent between mailboxes in the same Office 365 tenant. Exchange Online will "helpfully" go, "I know that address... this is the address you wanted!"
What API are you using? In Outlook Object Model / MAPI / EWS, you need to retrieve the PR_TRANSPORT_MESSAGE_HEADERS MAPI property (DASL name http://schemas.microsoft.com/mapi/proptag/0x007D001F)
We arrived at a many hoop solution.
The "Primary" email box now has some rules that look at the internet headers mentioned above (Message -> Properties -> look for 'To:').
If it finds an alias there, it will put the email in a corresponding folder for each alias.
Then we have logic apps listening to each of the alias folders which will then send the email's information to the _Core logic app that does the actual processing.

Can we prevent duplicate cases which are built by the email to case using email services?

using the salesforce Email Services can we do means prevent duplicate cases and How please???
I understand your pain. My users often complain that our service email address is included in email conversations and this creates a case for each email received. They then have to spend hours merging the cases and pulling out the relavant material. Worse, they have to manually move email attachments from the duplicate child case to the parent case.
One solution is to purchase an AppExchange application that provides a custom email handler that works well. Look for the Email to Case premium on the AppExchange.
https://sites.secure.force.com/appexchange/listingDetail?listingId=a0N30000001R5cyEAC
Or you can do what I did and build a custom email handler. See my blog for the code which is currently working in our organization:
http://sforcehacks.blogspot.com/2012/01/email-to-case-can-create-too-many-cases.html

MOSS sends two emails when a workflow is enabled

Perspective: I do not have access to SharePoint Designer, the ivory tower believes its for IT folk only. All the fixes I've read on the site are for people with access to Designer, so I'm reaching out for an alternative solution.
SO, I have a list that kicks off an approval workflow when a new item is added. My issue is that I receive 2 emails: one almost instantly from moss#mycompany.com. The second comes in a minute or two later from Forms
I've been up and down the workflow settings to try to get only a singular note. Is there something in my control that I can change? I fear that two emails will confuse users.
The first email contains the " has started on " verbiage.
The second email contains the "Task assigned by on . It also has two attachments (consistently) that are just regurgitations of the main body email.
Any assistance is surely appreciated!!
The reason why I was getting two emails was because I was setting myself as an approver as well.
The initial email was hey requestor (me) a new workflow was started. The second email was hey approver (me) you have something to approve.
In a regular scenario, I wouldn't be the requestor, so I wouldn't see that email. Since I was testing the solution against myself before rolling it out, I was unknowingly wearing both hats.
Crisis averted!!

Changing the sender of a Dynamics CRM e-mail in a plugin?

So, here's my situation. We have a department that needs the ability to use queues in CRM 4. They also need the ability to reply to e-mails that come to that queue from their department e-mail address. (So that any customer responses will go back to the queue to be handled by agents)
I originally was going to build a JavaScript customization that inserted a checkbox that said "Send From Business Unit". Toggling this would look up their department user based on the e-mail address on the Business Unit. I successfully got this working (as a concept), but found that actually sending triggers the dreaded "CrmCheckPrivilege failed."
Which is good, because that means CRM is actually enforcing security.
So my problem? I have no idea how to replicate this functionality and it's a must have for this customer group. Is there anyway to modify the e-mail after it's already gone through security checks via a plugin? Perhaps a pre-stage send plugin?
I want to be reasonably certain of success before I commit a lot of time to this solution. I'm also open to any other ideas too.
Thanks in advance,
Clif
Well, first, a "CrmPrivilegeCheck failed" can always be fixed by adjusting the user's roles and giving him the appropriate privilege (the privilegeId is always returned in the exception but may not be shown in the particular error dialog you are getting) and level, but this may not be wanted by the department.
A solution we have used is just slightly different from yours: Do not send the mails through another user, but through the queue. Queues can also be eMail senders in MSCRM. The queues should already have the correct eMail addresses set in order to work properly with the eMail router. Set up a way to determine the correct queue (like a field on the systemuser entity or a hardcoded queue name in your JavaScript) and set the from lookup accordingly in your JavaScript. That way the eMails will be sent using the name and address of the queue, so any direct replies will always have that queue as the recipient.

Resources