संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Admin SDK Groups Migration सेवा की मदद से, Apps Script में Admin SDK के Groups Migration API का इस्तेमाल किया जा सकता है. इस एपीआई की मदद से, Google Workspace डोमेन के एडमिन (इसमें रीसेलर भी शामिल हैं) सार्वजनिक फ़ोल्डर और डिस्ट्रिब्यूशन लिस्ट से ईमेल को Google Groups के चर्चा संग्रहों में माइग्रेट कर सकते हैं.
रेफ़रंस
इस सेवा के बारे में ज़्यादा जानकारी के लिए, Admin SDK Groups Migration API का रेफ़रंस दस्तावेज़ देखें. Apps Script की सभी ऐडवांस सेवाओं की तरह, Admin SDK Groups Migration सेवा भी सार्वजनिक एपीआई के ऑब्जेक्ट, तरीकों, और पैरामीटर का इस्तेमाल करती है. ज़्यादा जानकारी के लिए, तरीके के सिग्नेचर कैसे तय किए जाते हैं लेख पढ़ें.
नीचे दिए गए सैंपल कोड में, एपीआई के वर्शन 1 का इस्तेमाल किया गया है.
Gmail से Google ग्रुप पर ईमेल माइग्रेट करना
इस सैंपल में, उपयोगकर्ता के Gmail इनबॉक्स में मौजूद तीन सबसे नए थ्रेड से, RFC 822 फ़ॉर्मैट वाले तीन मैसेज मिलते हैं. साथ ही, यह ईमेल के कॉन्टेंट (अटैचमेंट के साथ) से एक ब्लोब बनाता है और उसे डोमेन में मौजूद Google ग्रुप में डालता है.
/** * 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"]],["आखिरी बार 2025-10-14 (UTC) को अपडेट किया गया."],[],[]]