Тёмный
No video :(

How to Automatically Archive Gmail Messages with Google Apps Script 

saperis
Подписаться 29 тыс.
Просмотров 3,5 тыс.
50% 1

Опубликовано:

 

6 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 14   
@JessieTheAgent
@JessieTheAgent 7 месяцев назад
I just started the video and this is great! Almost exactly what I’m looking for however I want to archive ALL incoming emails with a specified label as they come in. I cannot achieve this with regular rules because there is not a static trigger that would determine which emails are labeled. My team labels with their name as emails come in to denote which member is working on which thread. We would like to keep the inbox clear once an email is labeled. I’m going to watch through and learn but if anyone has tips for me I’d love to hear them!
@saperis
@saperis 7 месяцев назад
As far as I know, there is no way to run this archiving script when you add a label to a message. You would probably have to use a time based trigger: developers.google.com/apps-script/guides/triggers#available_types_of_triggers
@user-qh2so7vf7x
@user-qh2so7vf7x 11 месяцев назад
Great, Thanks, it that save the storage volume? and can and how unarchive it?
@saperis
@saperis 11 месяцев назад
Everything in Gmail uses up storage. So yes, if you archive messages they count towards your storage. To unarchive messages you probably could move them to inbox: developers.google.com/apps-script/reference/gmail/gmail-thread#movetoinbox
@jayasri-ft8040
@jayasri-ft8040 2 года назад
Super dear..
@saperis
@saperis 2 года назад
Thank you 😊
@b.revathib.revathi5668
@b.revathib.revathi5668 Год назад
Any idea how to download excels from delegated mailbox
@saperis
@saperis Год назад
There might be a way to access the inbox of a delegated mailbox if you are using a Google Workspace account. See this Stackoverflow page for more information: stackoverflow.com/questions/40855997/using-google-apps-script-api-to-access-another-user
@WasimNagy
@WasimNagy 2 года назад
Hi Chanel thanks a lot for the great work unfortunately i got an error as below Error ReferenceError: thred is not defined (anonymous) @ Code.gs:4 archiveThreads @ Code.gs:3 any idea how to fix that ?
@WasimNagy
@WasimNagy 2 года назад
this is the full code function archiveThreads() { let threads = GmailApp.getInboxThreads(); threads.forEach(function(thread){ if(calculateDifference(thred.getLastmessageDate()) > 30) { thread.moveToArchive(); } }); } function calculateDifference(messageDate) { const oneDay = 24 * 60 * 60 * 1000; const today = new Date(); const diffDays = Math.round(Math.abs((messageDate - today) / oneDay)); return diffDays; }
@WasimNagy
@WasimNagy 2 года назад
it's working now thanks again for the great job
@saperis
@saperis 2 года назад
Happy to hear that. 😀
@WasimNagy
@WasimNagy 2 года назад
@@saperis finally i can see this on my inbox ( No new emails! )
@saperis
@saperis 2 года назад
@@WasimNagy Great!
Далее
Google Apps Script Triggers Explained 👈🏽
14:32
Просмотров 32 тыс.
Google Apps Script Tutorial for Beginners
23:54
Просмотров 376 тыс.
Why Is Everyone Ditching Gmail?
12:21
Просмотров 1 млн
Mail Merge in Google Sheets & Gmail (for free)
12:52
Просмотров 769 тыс.
Tips for becoming a Developer Advocate
9:28
Просмотров 1,5 тыс.