Admin SDK 그룹 이전 서비스를 사용하면 Apps Script에서 Admin SDK의 Groups Migration API를 사용할 수 있습니다. 이 API를 사용하면 Google Workspace 도메인(리셀러 포함)의 관리자가 공개 폴더 및 메일링 리스트에서 Google 그룹스 토론 자료실로 이메일을 이전할 수 있습니다.
참조
이 서비스에 관한 자세한 내용은 Admin SDK Groups Migration API의 참조 문서를 참고하세요. Apps Script의 모든 고급 서비스와 마찬가지로 Admin SDK 그룹 이전 서비스는 공개 API와 동일한 객체, 메서드, 매개변수를 사용합니다. 자세한 내용은 메서드 서명 결정 방법을 참고하세요.
/** * 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;}
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(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."]]],[]]