Auto-Reply to only certain email address's on the thread.

224 views
Skip to first unread message

JJay Jensen

unread,
Sep 16, 2020, 7:38:14 PM9/16/20
to Google Apps Script Community
I am looking for a script that auto-reply's to an email that comes in, but the trick is I want it to only reply to certain emails in that email. 

Here is my use case:

We use a third party company that we have clients login to and submit an application/form. When the client submits the form, it is automatically emailed to my self, another person in my office and then to the client, all coming from a "donot...@thirdpartydomain.com".

Once we receive that email we then email the client (who was copied on the previous email) using an email template, telling them what the next steps are, how long it will be before we reach out to them again as well as who will be reaching out to them, etc.

What I am looking for is too have an auto responder that essentially just replies to the client. 

My only way of thinking is to do a reply all, but then not include the people who are in my office/same domain and to not include the "donot...@thirdpartydomain.com" email. But there could be other ways.

Any help would be greatly appreciated. Thanks in advance!

CBMServices Web

unread,
Sep 16, 2020, 8:01:44 PM9/16/20
to google-apps-sc...@googlegroups.com
Jay,

Why not use the original script that sends the email to the client when they fill out the form to also send the subsequent email. You don't need to wait for receiving the email in your inbox to send the subsequent email.


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/d349ec30-f980-4b36-969a-32324df98315o%40googlegroups.com.

Jonathan Butler

unread,
Sep 16, 2020, 8:03:02 PM9/16/20
to google-apps-sc...@googlegroups.com
The first step is to create a native gmail filter either programmatically or manually in your account that captures all the emails from the donoreply address. Then get the user label while also getting all of the threads. Loop through the threads based off of the amount of messages in them or based on who replied. For example if there is only one message in the thread you can assume it needs to be replied to. Then if it needs to be replied to you can use the gmail app to reply to the thread with whatever body you want to use. 

--

Darren D'Mello

unread,
Sep 18, 2020, 5:13:28 AM9/18/20
to google-apps-sc...@googlegroups.com
Would it be possible to share the existing email code, I can tweak that.

Reply all
Reply to author
Forward
0 new messages