অ্যাপস স্ক্রিপ্ট কুইকস্টার্ট
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
এই নিবন্ধটি আপনাকে ইমেল মার্কআপ পরীক্ষা করার জন্য স্কিমা সহ একটি ইমেল পাঠাতে Apps Script ব্যবহার করার উপায় দেখায়।
প্রকল্প তৈরি করা হচ্ছে
script.google.com এ যান। আপনি যদি প্রথমবার script.google.com
এ যান তবে আপনাকে একটি তথ্য পৃষ্ঠায় পুনঃনির্দেশিত করা হবে৷ স্ক্রিপ্ট সম্পাদকে এগিয়ে যেতে স্ক্রিপ্টিং শুরু করুন ক্লিক করুন। স্ক্রিপ্ট এডিটরে, একটি ফাঁকা প্রকল্পের জন্য একটি স্ক্রিপ্ট তৈরি করুন।
Code.gs
এর কোডটি নিম্নলিখিত দিয়ে প্রতিস্থাপন করুন:
একটি নতুন HTML ফাইল তৈরি করতে ফাইল > নতুন > এইচটিএমএল ফাইল নির্বাচন করুন। উপরের জাভাস্ক্রিপ্টের প্যারামিটারের সাথে মেলে mail_template
ফাইলটির নাম দিন। এইচটিএমএল ফাইলের বিষয়বস্তুকে নিম্নলিখিত দিয়ে প্রতিস্থাপন করুন:
স্ক্রিপ্ট পরীক্ষা করা হচ্ছে
স্ক্রিপ্ট পরীক্ষা করতে:
- প্রকল্পটি সংরক্ষণ করুন।
-
Code.gs
এর জন্য ট্যাবটি নির্বাচন করুন। - নিশ্চিত করুন যে ফাংশন
testSchemas
Select function
ড্রপডাউন মেনুতে নির্বাচিত হয়েছে। - Apps Script ডেভেলপমেন্ট এনভায়রনমেন্টে
Run
এ ক্লিক করুন।
আপনি যখন প্রথমবার স্ক্রিপ্টটি চালাবেন তখন আপনাকে অনুমোদন দিতে বলা হবে, তারপরে আপনাকে এটি পুনরায় চালাতে হবে। স্ক্রিপ্টটি চালানোর পরে, নিচের স্ক্রিনশটের মতো একটি গো-টু অ্যাকশন বোতাম দিয়ে নিজের কাছ থেকে পাঠানো একটি ইমেলের জন্য আপনার ইনবক্স চেক করুন:

স্ক্রিপ্ট কিভাবে কাজ করে?
testSchemas
ফাংশন mail_template.html
নামের ফাইল থেকে এইচটিএমএল বিষয়বস্তু পড়ে এবং সেই বিষয়বস্তুটিকে বর্তমানে প্রমাণীকৃত ব্যবহারকারীকে ইমেল হিসেবে পাঠায়। Google-এর সাথে নিবন্ধন করাতে যেমন ব্যাখ্যা করা হয়েছে, আপনার নিজের কাছে পাঠানো সমস্ত স্কিমা Gmail-এ প্রদর্শিত হবে, তাই স্ক্রিপ্ট দ্বারা পাঠানো ইমেল পরীক্ষার উদ্দেশ্যে নিবন্ধনের প্রয়োজনীয়তা উপেক্ষা করতে ব্যবহার করা যেতে পারে।
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-08-29 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# Apps Script Quickstart\n\nThis article shows you how to use [Apps Script](/apps-script) to send yourself an email with schemas in order to test email markup.\n\nCreating the project\n--------------------\n\nVisit [script.google.com](https://script.google.com). If this is the first time you've been to `script.google.com`, you'll be redirected to an information page. Click **Start Scripting** to proceed to the script editor. In the script editor, create a script for a **Blank Project**.\n\nReplace the code in `Code.gs` with the following: \ngmail/markup/Code.gs \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/gmail/markup/Code.gs) \n\n```javascript\n/**\n * Send an email with schemas in order to test email markup.\n */\nfunction testSchemas() {\n try {\n const htmlBody = HtmlService.createHtmlOutputFromFile('mail_template').getContent();\n\n MailApp.sendEmail({\n to: Session.getActiveUser().getEmail(),\n subject: 'Test Email markup - ' + new Date(),\n htmlBody: htmlBody\n });\n } catch (err) {\n console.log(err.message);\n }\n}\n```\n\nSelect **File \\\u003e New \\\u003e Html file** to create a new HTML file. Name the file `mail_template` to match the parameter in the JavaScript above. Replace the content of the HTML file with the following: \ngmail/markup/mail_template.html \n[View on GitHub](https://github.com/googleworkspace/apps-script-samples/blob/main/gmail/markup/mail_template.html) \n\n```html\n\u003c!--\n Copyright 2022 Google LLC\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n--\u003e\n\n\u003chtml\u003e\n \u003chead\u003e\n \u003cscript type=\"application/ld+json\"\u003e\n {\n \"@context\": \"https://schema.org\",\n \"@type\": \"EmailMessage\",\n \"description\": \"Check this out\",\n \"potentialAction\": {\n \"@type\": \"ViewAction\",\n \"target\": \"https://www.youtube.com/watch?v=eH8KwfdkSqU\"\n }\n }\n \u003c/script\u003e\n \u003c/head\u003e\n \u003cbody\u003e\n \u003cp\u003e\n This a test for a Go-To action in Gmail.\n \u003c/p\u003e\n \u003c/body\u003e\n\u003c/html\u003e\n```\n\nTesting the script\n------------------\n\nTo test the script:\n\n1. Save the project.\n2. Select the tab for `Code.gs`.\n3. Make sure the function `testSchemas` is selected in the `Select function` dropdown menu.\n4. Click `Run` in the Apps Script development environment.\n\nThe first time you run the script you'll be asked to grant authorization, after which you should re-run it. After the script runs, check your inbox for an email sent from yourself with a [Go-To Action](/workspace/gmail/markup/reference/one-click-action) button, as in the following screenshot:\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nHow does the script work?\n-------------------------\n\nThe `testSchemas` function reads the HTML content from the file named `mail_template.html` and sends that content as an email to the currently authenticated user. As explained in [Registering with Google](/workspace/gmail/markup/registering-with-google), all schemas you send to yourself will be displayed in Gmail, so the email sent by the script can be used to ignore the registration requirements for testing purposes."]]