Send email from group email address - azure-active-directory

I am searching for an option to send an email from an Office 365 Group via Microsoft Graph.
I mean to send an email to another email address like test#yahoo.com.The group member can send email from this Group, but how can I get access via the API?
I can't find anything in the documentation for Groups or Users.

A Group doesn't have a mailbox in the same way as a User might. Instead of traditional emails, Groups use Conversations. A Conversation may contain multiple threads which are made up of one or more posts.
Members of a Group may receive these conversations as an email, but only if they are subscribed to conversations from that Group. If a given member isn't subscribed, they'll only see the conversations when accessing that Group directly.

Related

Gmail API - Service Account delegation

I'm looking into using the GMail API to send out emails programtically for one of our systems. I believe I need to create a service account and then set it up with domain-wide-access in order to delegate the email sending ( so the email appears to come from the actual user and not my program ). My question is, if I go this route - is there a way to block out certain users so that the service account cannot "delegate" for them? For example I would like to be able to generate and send emails for our sales team, but I do not want the api to be able to generate any emails for our senior officers.
The flow of things would be....our program gathers info from our database and then loops through this data and uses the gmail api to generate the emails for the sales staff. I'm very new to the google/gmail api and am leery of giving the service account domain-wide-access for delegation.
Is there a "best practice" approach for doing something like this?
Unfortunately it is not possible to restrict domain-wide delegation to only certain users in the admin / cloud console settings
You user enable DOMAIN-WIDE delegation or no delegation at all
You can only control porgrammatically who will be impersonated
One option is to pre-filter your database so that your code is fed only with email addresses of users that you want to impersonate
Another option would be to implement an if statement that retrieves e.g. the orgUnit for each email and does or does not impersonate the user based on his orgUnit (e.g impersonate only the orgUnit "Sales staff")

How can I set default reply address in Gmail by API?

I'm trying to change "When replying to a message" (card "Accounts", section "Send mail as") to "Reply from the same address to which the message was sent" in Gmail Settings" by Gmail API (using service account that was delegated domain-wide authority) and I cannot find it in the docs (https://developers.google.com/gmail/api/v1/reference/users/settings/sendAs).
To explain why I want to do this: I'm adding certain role based Google Groups my users are member of to their send email as preferences (by the service account with domain wide authority). For example, users responsible for dealing with legal# address are member of Google Group called legal and they have legal mails in their mailbox. When responsible users change, I just change the membership and new users receive the mails. The problem is that just the first email comes to legal# and reply goes from john.smith# for example. Because of that, I decided to have them reply from legal#, so those who requests something from Legal Departament knows they are communicating with whole Legal Departament and not Mr Smith only. But when Gmail doesn't automatically choose correct address when replying to the legal mail, it doesn't do what I'm trying to do.
It doesn't matter for me if I change it in admin console or by script running on all users. I wasn't able to use any of those ways.
Thank you for your help,
Martin
I'm pretty certain that Gmail setting ("always reply from xx#yy, or reply from the same address to which the message is sent") is not available in the Gmail API. It really is a client-side issue, since the email client chooses the "From:" line when composing each message or reply.
For your issue, you should be able to use Google groups as a collaborative inbox, see: https://support.google.com/a/answer/167430?hl=en
This user note explains your use case, see: https://productforums.google.com/forum/#!topic/apps/siprUn9Nm9g

How to edit a mailing list using gmail API?

I have a requirement where I want to edit a mailing list - add and remove members - quite frequently (weekly, and sporadically, daily).
Going through gmail API documentation, I didn't find anything that could point me to a solution for the same.
Is this feature supported? If yes, can you point me to a doc page?
Cheers
You may want to check the Google Contacts API
.
Contact Group Entry
Contacts can be placed into user-defined groups. You can create, retrieve, update, and delete these groups using the Contacts Data API, and you can add contacts to a group or remove contacts from a group. For details, see the following sections.
To create a new contact group, send an authorized POST request to the contact groups feed URL with the contact group entry data in the body:
https://www.google.com/m8/feeds/groups/{userEmail}/full
With the appropriate value in place of userEmail. Be noted that the special userEmail value default can be used to refer to the authenticated user.

getPlainBody Javascript

Concatenate inbound email messages into a single google document each week and share that document via email. Inbound messages would be filtered into to a specific gmail label as a means of identifying them. A follow-on enhancement would be to lookup the name of the person submitting the request based on the inbound email address in a google contact and add that to the messages concatenated into the google doc.

Is there a way to link 2 the same email across multiple users

We are looking for a way to determine if an email in different users gmail is the same email. For example Person A sends an email to Person B and C who are in the same Google Apps instance.
When retrieving the email with the gmail API the Id and ThreadId are different for the email in both user B and C accounts. Is there some common identifier or is a case of using something like "Sender" + "Recipients" + "Time Sent" as the relating key?
Thanks for your help.
Not sure if/how this is related to Gmail API, but why not use the Message-Id header? (In conjunction with Date header and possibly From if you want to be sure/paranoid. Note that many assumptions may be broken if a mailing-list is part of the delivery to the recipients.)

Resources