I'm looking for a script that will search the body text of emails from a specific sender, find a string of text in the email, such as "You'll receive: US$7.16", then take the number 7.16 and add it to a Google Doc spreadsheet where it would be broken down showing the total for the day, week, month, year. Does anything like this exist, or something like it that could be modified?
相关问题
- How can I force all files in a folder to be owned
- Google Apps Script: testing doPost() with cURL
- Google Apps Script to turn in, grade, and return a
- Script fails on SpreadsheetApp.openById - Requires
- Gmail IMAP with PHP?
相关文章
- How to allow access for importrange function via a
- Google app script trigger not working
- Debug HTML Email in Gmail App
- Sending email using php, gmail, and swiftmailer ca
- Set Date/Time to 00:00:00
- indexOf returning -1 despite object being in the a
- How can my Google Apps Script be run by others the
- How to read the Content Type header and convert in
You could start with the example in How to use Google App Scripts to retrieve Gmail emails in a customised way? (Author even states "Here's a neat javascript code I wrote to get all emails from my Gmail and put the list of sender name in a google spreadsheet.")
From there, you could identify messages from the particular sender you're interested in. (Alternatively, you could use GMail filters to label the email from that sender, then use getUserLabelByName() to grab the threads without requiring a search.)
Once you have the threads & messages, you can grab the mail content as a string using getPlainBody(), from which you can retrieve the monetary values. How does one find the currency value in a string?