Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Mit dem Admin SDK-Migrationsdienst für Gruppen können Sie die Groups Migration API des Admin SDK in Apps Script verwenden. Mit dieser API können Administratoren von Google Workspace Domains (einschließlich Resellern) E-Mails aus öffentlichen Ordnern und Verteilerlisten in Google Groups-Diskussionsarchive migrieren.
Referenz
Weitere Informationen zu diesem Dienst finden Sie in der Referenzdokumentation für die Admin SDK Groups Migration API. Wie alle erweiterten Dienste in Apps Script verwendet der Admin SDK-Migrationsdienst für Gruppen dieselben Objekte, Methoden und Parameter wie die öffentliche API. Weitere Informationen finden Sie unter Methodensignaturen bestimmen.
Im folgenden Beispielcode wird Version 1 der API verwendet.
E-Mails aus Gmail zu einer Google-Gruppe migrieren
In diesem Beispiel werden drei Nachrichten im RFC 822-Format aus den jeweils drei neuesten Threads im Gmail-Posteingang des Nutzers abgerufen, ein Blob aus dem E-Mail-Inhalt (einschließlich Anhängen) erstellt und in eine Google-Gruppe in der Domain eingefügt.
/** * 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;}
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 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."]]],[]]