Google Group App Script

567 views
Skip to first unread message

Ali Kanani

unread,
Apr 19, 2019, 3:47:48 PM4/19/19
to Google Apps Script Community
Hello Everyone,

I need to write a script that selects all emails (posts) older than 90 days in a Google group and moves them to another group. Is this possible to do?


Highly appreciate your time


Ali

Alexander Ivanov

unread,
Apr 22, 2019, 7:26:58 AM4/22/19
to Google Apps Script Community
Hi Ali!

I think it's not possible. As I see a group is an end point of receiving the letter. It is not quite clear why this point changes after 90 days.

Sorry if I got you wrong.

Best wishes!

Ali Kanani

unread,
Apr 22, 2019, 8:21:41 AM4/22/19
to Google Apps Script Community
Let's make it simpler. There is a "Move" action in Google Groups to move a topic or an email to another Google Groups. I am trying to write a script for this matter. The API for Google Groups is really limited.

Romain Vialard

unread,
Apr 22, 2019, 8:37:07 AM4/22/19
to Google Apps Script Community
Sorry, no, this "Move" action is not supported by the API.
There are several APIs available for Google Groups:
But there's no API to interact with messages in a specific group (and thus no API to move a message from one group to another).

You could try to use the Gmail API to answer your need:
  • Subscribe to receive all emails / posts in a Gmail inbox.
  • Use the Gmail API to read the Gmail inbox and search for emails sent to the group older than 90 days and not already processed.
  • Forward those emails / posts to the email address of your second group.
In that case though, you will simply copy the posts to your second group and not move them (so they will still be visible in the first group). 

Jonathan Butler

unread,
Apr 22, 2019, 10:29:00 AM4/22/19
to google-apps-sc...@googlegroups.com
Don't the posts show up as an email? Wouldn't you be able to create a label for all posts that come in a specific group through Gmail? Then get the emails with GmailApp and pull the emails in the order in a list with the posters and responses.  You can then create the items yourself in a new group. 

Of course, the emails would be yours but you could list the original posters. To add an item to the new group just email the new group email with the subject stolen from the thread you're archiving. The system from what it seems is just built off of regular email. 

I do not know how you delete posts through Google Groups because I have never been the admin of a group. If all else fails, you can do that manually.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-script-community.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/dc589e80-9725-4e18-86ee-79428916830c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages