0
votes

I am using Gmail App script to auto forward my custom label emails to two different senders, but I am getting facing some problem which i want to discuss here.

At start of program, i am getting number of threads in that label than getting message and forwarding that message to two different emails, after that i am marking it as READ message and than removing its label. I used timely driven trigger for this code.

Let say a user "emailuser1" email arrived with custom label, and this user have previous five conversation, which are READ before and have no label (It means there are now One unread + Five read Emails of user “emailuser1”).

My program is which similar to the following program http://www.labnol.org/internet/auto-forward-gmail-messages/20665/

https://docs.google.com/spreadsheet/ccc?key=0Aofk8L6brI_edFUyaElHeDBKbVBJU3ppXzh1YjVTZUE

The problem is that, the program is sending 6 emails (1 unread + 5 read messages) instead of only 1 email. Next time when user “emailuser1” email comes, program will send 7 emails.

To avoid this multiple sent, I try a new technique by moving read and forwarded message to TRASH folder, But the problem is remain.

Also in Gmail General Settings, I marked conversion view to OFF.

Any idea how to solve this issue, I have searched a lot for different Gmail App commands functions, but was not getting correct response.

Thanks and Regards, leo

2
It would help greatly if we could see your code - mhawksey

2 Answers

0
votes

I think it has something to do with the fact that Gmail collates all of your messages from the same address into a thread, even if you have conversation view set to off in your preferences.

This causes a problem, because so far I have not seen a way to see what label is applied to a message and not to the entire thread.

0
votes

What about having the script start with a search that excludes all emails labeled "AlreadyForwarded", and having it label every email it forwards with that tag.