Send file via Teams (like MAPISendMail) - winapi

My (editor-like) Windows desktop program can create a new e-mail with the current project attached using MAPISendMail. A customer wants the same functionality for Microsoft Teams.
For the web version, I think I can probably do that with Graph API.
But I can't find anything for the desktop app version. Is there a way to do that?
Bonus:
It would be great if the user could manually specify recipient + body text in Teams (and not in my program).

So you can't actually attach files to messages directly - you basically upload the file to a web location, and then provide a link to the file in the message. As an example, you can upload to the SharePoint document library that exists in the "Files" tab (something like this). Then, in terms of sending the message, you can send to a Team/Channel quite easily using a Webhook. This does not support #mentions the moment though. Another option is to use Graph to send the message.
If you're wanting instead to send a kind of 'private' message to the user, you'd need to look into creating a bot, and sending a 'Proactive' message

Related

Microsoft Teams go to a conversation using a deeplink

we have an app for MS Teams which users can start a conversation and send messages to. The app does some processing and returns the response back. I am looking for the ability to open an precreated conversation using a link. I have needed information like conversation id etc. How do i create a link that can be used for this navigation?
To be more specific this doc is not helpful https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/build-and-test/deep-links#deep-linking-to-a-chat
The link i need is for the conversation. Currently it is possible to manually copy that link by right clicking on any conversation and use "Copy link". Is there a way to get it or generate it when user creates the conversation. A sample link copied from looks like below
https://teams.microsoft.com/l/message/19:a0a0088174a644cb91409f4d8f79d888#thread.tacv2/1612324568748?tenantId=04e930f3-0866-4a6d-b07c-a4737e8f9865&groupId=087bf290-deb5-4790-b159-bf86914765b4&parentMessageId=1612324568748&teamName=Sales%20Team&channelName=FlashCX%20Sales&createdTime=1612324568748
So trying to see if i can either get this the URL using apis or can generate with the parts involved
#Moblize - Currently you can create Deep-link to chat for particular conversation. You cannot create a link which will redirect to a particular message in channel. Please check this docs for info.

Is there a way to open up a known Outlook email through Java 11? (Web or Local)

Short Version:
I want to open any specific Outlook email from my Java app, either locally through the Outlook app or through the website on a browser. I already have the email information like folder, message ID, UID, sender, receiver, etc but not the email ID used in the URL of the Outlook website. Does anyone know of a way to do either of these things through Java?
Long Version:
I'm creating a software for my company in Java that has a built-in email client for Outlook emails so the emails can be linked with jobs in various ways. So far I've been able to make good progress with the email client section in terms of displaying a list of emails and being able to display a chosen email, but recently I've realized creating a GUI for an email editor (keeping track of reply chains, dragging in images for inline attachments, etc) is quite the gargantuan task to do on my own(JavaFX's HTML Editor could use a lot of work).
My band-aid solution for now is to have my program open the chosen email up through either:
Some (Windows 10) system command by calling the Outlook desktop application to show the email by some sort of ID (maybe UID?). I know on some level that this is possible because our company has an old program written in C# that can indeed do that.
Opening up the system's default browser with a link to "https://outlook.office365.com/mail/folder_name/id/insert_id_here". This is my preferred solution.
Here are my problems with each option so far:
There doesn't seem to be any resource I could find that provides an answer to this. The closest I can find are threads that explain how to open the default mail application with options to pre-populate to/from/subject/body sections (not to mention you can't pre-populate the body with anything besides text! So much for reply/forward messages with HTML formatting and attachments!). Another problem is that the old program I mentioned displays emails by finding the Outlook application's files (presumably the local OST file). I have no idea how the old program's able to call Outlook to show emails and even then, there's a chance that there's no Java equivalent. I, however, am using JavaMail to load up my mail, as I think it's better to talk to the Outlook mail server to fetch/push mail updates rather than wait for the Outlook app to sync up. This creates a problem because even if I knew how to call Outlook, my application may be more up to date than the Outlook app (especially if Outlook is not already open) and if call before Outlook updates, Outlook wouldn't be able to show it.
Again, I can't seem to find a resource for explaining these URL IDs. They're not the same as the mail's UIDs, and they don't seem to be anywhere in the mail's contents when grabbing mail through JavaMail. The most I was able to get from research was that they were called "long IDs", as they were just long strings (seemingly non-sequential) but that might've just been a made-up name from the article as I've found no other references to it. There's a chance that they could be some sort of encoded UID but I didn't see any note of JavaMail having to decrypt to get UIDs in the documentation. I doubt I'd be able to make any more progress with this option, but if there's a solution similar to this (perhaps some sort of script that opens up Outlook online, searches by some identifier, like body contents, and pulls up the first result? Idk much about browser scripts) I'd be happy to hear it.

Yasoon - Modify existing email, replace file with http(s) share link

Can the Yasoon Outlook development system modify existing emails, so that I could replace all attachments with links to the file from our internal cloud storage environment?
Or does anyone know of an app that will let me do this? I have seen the ones for Box/Dropbox/etc, but we are using FileCloud, and they have a very rich API in addition to the storage being hosted internally.
What the company would like to do is the following:
Select attachments by criteria
Upload the attachment(s) to FileCloud (FileCloud API)
Set the file as shared, with the mailfile owner being the only
authorized user (FileCloud API)
Replace the file in the email with the new share URL from FileCloud
And continue on until all selected attachments have
been processed in the mail file.
Tobi from Yasoon here, sorry for not getting back earlier.
Our tool is probably overblown for this use case though it's possible (https://github.com/yasoonOfficial/com.yasoon.attachment.export)
But you should probably look into the new Outlook API: https://dev.outlook.com/MailAppsGettingStarted/GetStarted

Get user email in windows 10 universal app

I am trying to build a control that the user can use to send feedback to developer. I am using email as a delivery method and I leverage sendgrid email service for this. Now I want to know the users email address so I can respond back to the user's concern. I am not sure how to get the user's email in window 10. Any help or pointers please?
I would strongly recommend to use the sharing approach that has been introduced with Windows 8 - instead of writing and maintaining your own mail functionality and trying to access additional user data.
Have a look at the existing and built in e-mail functionalities. They make use of the user's connected mail accounts and the mail app. This way you don't need to worry about handling the message transmission or anything but rather hand the information over to the mail client. This way you also know how to reply back.
And as a bonus, the user can still access their message via the Sent Mails folder :)
There is a specific class for that, the EmailMessageClass (https://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.email.emailmessage.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) as well as a dedicated guide with code example.
https://msdn.microsoft.com/en-us/library/windows/apps/mt269391.aspx
Essentially you can prepopulate the Mail fields with necessary app information where applicable. The user gets to choose which accounts he wants to send the mail from, but it will open in the mail client.

Simulating an attachment in the emailtask

In phone7 development, being able to send an email requires the use of the email task. This object doesn't not have an attachments property, and many ppl on various forums have complained about this particular lack of functionality. The problem is that Microsoft applications such as the picture gallery and OneNote have the ability to attach images and sound recordings to emails. This implies that there is a way to attach them.
Question: Is there a "hack" or other method that can be used to send emails with attachments in phone7?
No, there is no way to send attachments via the EmailComposeTask in a third party app. If you don't want to use an EmailComposeTask, you could create a server that runs a webservice which performs the sending of the email. Your app could then upload the attachment to that webservice.

Resources