Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Usługa migracji grup w Admin SDK umożliwia korzystanie z interfejsu Groups Migration API z pakietu Admin SDK w Apps Script. Ten interfejs API daje administratorom domen Google Workspace (w tym sprzedawcom) możliwość przenoszenia e-maili z folderów publicznych i list adresowych do archiwów dyskusji Grup dyskusyjnych Google.
Dokumentacja
Szczegółowe informacje o tej usłudze znajdziesz w dokumentacji referencyjnej interfejsu Admin SDK Groups Migration API. Podobnie jak wszystkie zaawansowane usługi w AppsScript, usługa Migracja grup w Admin SDK korzysta z tych samych obiektów, metod i parametrów co publiczny interfejs API. Więcej informacji znajdziesz w artykule Jak określane są podpisy metod.
Przykładowy kod poniżej korzysta z wersji 1 interfejsu API.
Przenoszenie e-maili z Gmaila do grupy dyskusyjnej Google
Ten przykład pobiera 3 wiadomości w formacie RFC 822 z każdego z 3 najnowszych wątków w skrzynce odbiorczej Gmaila użytkownika, tworzy blob z treściami e-maili (w tym załącznikami) i wstawia go w Google Group w domenie.
/** * Gets three RFC822 formatted messages from the each of the latest three * threads in the user's Gmail inbox, creates a blob from the email content * (including attachments), and inserts it in a Google Group in the domain. */functionmigrateMessages(){// TODO (developer) - Replace groupId value with yoursconstgroupId='exampleGroup@example.com';constmessagesToMigrate=getRecentMessagesContent();for(constmessageContentofmessagesToMigrate){constcontentBlob=Utilities.newBlob(messageContent,'message/rfc822');AdminGroupsMigration.Archive.insert(groupId,contentBlob);}}/** * Gets a list of recent messages' content from the user's Gmail account. * By default, fetches 3 messages from the latest 3 threads. * * @return {Array} the messages' content. */functiongetRecentMessagesContent(){constNUM_THREADS=3;constNUM_MESSAGES=3;constthreads=GmailApp.getInboxThreads(0,NUM_THREADS);constmessages=GmailApp.getMessagesForThreads(threads);constmessagesContent=[];for(leti=0;i < messages.length;i++){for(letj=0;j < NUM_MESSAGES;j++){constmessage=messages[i][j];if(message){messagesContent.push(message.getRawContent());}}}returnmessagesContent;}
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-06-05 UTC."],[[["The Admin SDK Groups Migration service enables administrators to migrate emails from public folders and distribution lists to Google Groups using Apps Script."],["This advanced service requires prior enabling in Google Workspace domains (including resellers) before use."],["Developers can leverage the Admin SDK Groups Migration API to programmatically manage email migration workflows."],["Sample code provided demonstrates how to migrate RFC 822 formatted emails from Gmail to a designated Google Group."],["Comprehensive documentation and support resources are available to guide developers in utilizing the service effectively."]]],[]]