تمّ إيقاف هذا العمود نهائيًا. بدلاً من ذلك، استخدِم خدمة People API المتقدمة.
حقل بريد إلكتروني في جهة اتصال
الطُرق
الطريقة | نوع القيمة التي يتم عرضها | وصف قصير |
---|---|---|
get | String | احصل على عنوان هذا الحقل. |
get | Object | تحصل على تصنيف هذا الحقل. |
is | Boolean | تحصل على ما إذا كانت هذه هي قيمة الحقل الأساسي. |
set |
| تُستخدَم لضبط عنوان هذا الحقل. |
set |
| ضبط هذا الحقل على "أساسي" |
set |
| لضبط تصنيف هذا الحقل. |
set |
| لضبط تصنيف هذا الحقل. |
الطرق المتوقّفة
الطريقة | نوع القيمة التي يتم عرضها | وصف قصير |
---|---|---|
| void | يؤدي ذلك إلى حذف عنوان البريد الإلكتروني هذا من جهة الاتصال. |
| String | تعرِض هذه السمة الاسم المعروض لعنوان البريد الإلكتروني هذا. |
|
| لضبط الاسم المعروض لعنوان البريد الإلكتروني هذا. |
مستندات تفصيلية
getAddress()
احصل على عنوان هذا الحقل.
// Logs the address for the 'Home Address' field for contact 'John Doe'. // Can be used similarly for other fields that contain addresses. const contacts = ContactsApp.getContactsByName('John Doe'); const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS); Logger.log(homeAddress[0].getAddress());
الإرجاع
String
: العنوان كسلسلة
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
getLabel()
تحصل على تصنيف هذا الحقل. قد يكون هذا الحقل أو ExtendedField أو String.
// Logs the label for all the address fields associated with contact // 'John Doe'. This method can be similarly called for any field that has // a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); for (let i = 0; i < addressFields.length; i++) { Logger.log(addressFields[i].getLabel()); }
الإرجاع
Object
: تصنيف هذا الحقل
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
isPrimary()
تحصل على ما إذا كانت هذه هي قيمة الحقل الأساسي.
// Logs whether or not the first address field associated with contact // 'John Doe' is labeled as primary. This method can be similarly called // for any field. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); Logger.log(addressFields[0].isPrimary());
الإرجاع
Boolean
- ما إذا كان هذا هو الحساب الأساسي
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
setAddress(address)
تُستخدَم لضبط عنوان هذا الحقل.
// Sets the address for the 'Home Address' field for contact 'John Doe'. // Can be used similarly for other fields that contain addresses. const contacts = ContactsApp.getContactsByName('John Doe'); const homeAddress = contacts[0].getAddresses(ContactsApp.Field.HOME_ADDRESS); homeAddress[0].setAddress('123 Main St, Raleigh, NC, 27601');
المعلمات
الاسم | النوع | الوصف |
---|---|---|
address | String | العنوان الجديد |
الإرجاع
: هذا الحقل مفيد لإنشاء سلاسل.Email
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
setAsPrimary()
ضبط هذا الحقل على "أساسي"
// Sets the first address field associated with contact 'John Doe' // as primary. This method can be similarly called for any field. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setAsPrimary();
الإرجاع
- حقل القيمة هذا للتسلسلEmail
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
setLabel(field)
لضبط تصنيف هذا الحقل.
// Sets the label to 'Work' for the first address field associated // with contact 'John Doe'. This method can be similarly called for any // field that has a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setLabel(ContactsApp.Field.WORK_ADDRESS);
المعلمات
الاسم | النوع | الوصف |
---|---|---|
field |
| التصنيف العادي الجديد |
الإرجاع
- حقل القيمة هذا للتسلسلEmail
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
setLabel(label)
لضبط تصنيف هذا الحقل.
// Sets the label to 'Apartment' for the first address field associated // with contact 'John Doe'. This method can be similarly called for any // field that has a label. const contacts = ContactsApp.getContactsByName('John Doe'); const addressFields = contacts[0].getAddresses(); addressFields[0].setLabel('Apartment');
المعلمات
الاسم | النوع | الوصف |
---|---|---|
label | String | التصنيف الجديد لهذا الحقل |
الإرجاع
: هذا الحقل مفيد لإنشاء سلاسل.Email
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
الطرق المتوقّفة
deleteEmailField()
deleteEmailField()
تمّ إيقاف هذا العمود نهائيًا. تم إيقاف هذه الدالة نهائيًا ويجب عدم استخدامها في النصوص البرمجية الجديدة.
يؤدي ذلك إلى حذف عنوان البريد الإلكتروني هذا من جهة الاتصال.
// Retrieves and deletes the work email address for contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const workEmail = contacts[0].getEmails(ContactsApp.Field.WORK_EMAIL); workEmail[0].deleteEmailField();
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
getDisplayName()
getDisplayName()
تمّ إيقاف هذا العمود نهائيًا. تم إيقاف هذه الدالة نهائيًا ويجب عدم استخدامها في النصوص البرمجية الجديدة.
تعرِض هذه السمة الاسم المعروض لعنوان البريد الإلكتروني هذا.
// Logs the display name for the work email address for contact 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const workEmail = contacts[0].getEmails(ContactsApp.Field.WORK_EMAIL); Logger.log(workEmail[0].getDisplayName());
الإرجاع
String
: الاسم المعروض لعنوان البريد الإلكتروني هذا
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds
setDisplayName(name)
setDisplayName(name)
تمّ إيقاف هذا العمود نهائيًا. تم إيقاف هذه الدالة نهائيًا ويجب عدم استخدامها في النصوص البرمجية الجديدة.
لضبط الاسم المعروض لعنوان البريد الإلكتروني هذا.
// Sets the display name to 'Doe, John' for the work email address for contact // 'John Doe' const contacts = ContactsApp.getContactsByName('John Doe'); const workEmail = contacts[0].getEmails(ContactsApp.Field.WORK_EMAIL); workEmail[0].setDisplayName('Doe, John');
المعلمات
الاسم | النوع | الوصف |
---|---|---|
name | String | الاسم المعروض الجديد لعنوان البريد الإلكتروني هذا |
الإرجاع
: حقل البريد الإلكتروني هذا، وهو مفيد لإنشاء سلاسلEmail
التفويض
تتطلّب النصوص البرمجية التي تستخدِم هذه الطريقة الحصول على إذن واحد أو أكثر من النطاقات التالية:
-
https://www.google.com/m8/feeds