'Capture the potential subscriber's Name, Email id in a google form and then programmatically add it to the Google group
I want to write a code for Google Apps Script, so that whenever a entry (email) from google form is saved in a google sheet, that mail address is added to a google group.
Solution 1:[1]
The GroupsApp only allows read methods. You need to use the Admin Directory API for this. In short, it requires the following steps:
- Creating a service account on GCP
- Importing the OAuth2 libarary
- Enabling domain-wide delegation
- Adding the required scopes in the admin console
- Impersonating a super-user
- Enable the Admin SDK API
I wrote a detailed article, it's the example number three.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dmitry Kostyuk |
