/** * Creates a Google Doc and sends an email to the current user with a link to the doc. */ function createAndSendDocument(){ try{ // Create a new Google Doc named 'Hello, world!' const doc =DocumentApp.create('Hello, world!');
// Access the body of the document, then add a paragraph. doc.getBody().appendParagraph('This document was created by Google Apps Script.');
// Get the URL of the document. const url = doc.getUrl();
// Get the email address of the active user - that's you. const email =Session.getActiveUser().getEmail();
// Get the name of the document to use as an email subject line. const subject = doc.getName();
// Append a new string to the "url" variable to use as an email body. const body ='Link to your doc: '+ url;
// Send yourself an email with a link to the document. GmailApp.sendEmail(email, subject, body); }catch(err){ // TODO (developer) - Handle exception console.log('Failed with error %s', err.message); } }
Save এ ক্লিক করুন .
শিরোনামহীন প্রকল্পে ক্লিক করুন।
আপনার স্ক্রিপ্টের জন্য একটি নাম লিখুন এবং Rename এ ক্লিক করুন।
অনুরোধ করা হলে, স্ক্রিপ্ট অনুমোদন করুন. যদি OAuth সম্মতি স্ক্রীন সতর্কতা প্রদর্শন করে, এই অ্যাপটি যাচাই করা হয়নি , তাহলে Advanced>Go to {Project Name} (অনিরাপদ) নির্বাচন করে চালিয়ে যান।
স্ক্রিপ্ট এক্সিকিউশন সম্পূর্ণ হলে, ইমেলের জন্য আপনার Gmail ইনবক্স চেক করুন।
ইমেলটি খুলুন এবং আপনার তৈরি করা নথিটি খুলতে লিঙ্কটিতে ক্লিক করুন।
[[["সহজে বোঝা যায়","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-01-14 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["This script automates the creation of a Google Doc and emails you a link for access."],["You'll need a Google Account and web browser to use this automation script."],["The script involves pasting provided code into the Apps Script editor and running it after authorization."],["Upon successful execution, you'll receive an email containing the link to your newly created Google Doc."],["Explore further options to extend functionalities with Google Docs, Sheets, and Slides or learn basic JavaScript."]]],[]]