@nowjust a test
Wed Jan 18 02:50:17 PST 2017 INFO: Parsing date and body from email with regex:/^\s*@([^<]*)(<[\s\S]*)/ | |||||||||||||
Wed Jan 18 02:50:17 PST 2017 INFO: Empty Matches Now, I am not a regexp guru, but to me this sounded like looking for a pattern starting with zero or more white spaces, followed by "@", zero or more characters (anything but "<") plus a second string starting at < and continuing with any char. This seems weird, as it's not mandatory to have the < anywhere in a mail message. However, if I format the first line to be: @now <then the mail gets sent as expected and the matching finds the two substrings:
|
<just a test.
Wed Jan 18 02:50:17 PST 2017 INFO: Starting main() |
Wed Jan 18 02:50:17 PST 2017 INFO: User preferences object empty.. reloading.. |
Wed Jan 18 02:50:17 PST 2017 INFO: Loading default property for key:bcc value: false |
Wed Jan 18 02:50:17 PST 2017 INFO: -- Prefs -- |
Wed Jan 18 02:50:17 PST 2017 INFO: Triggers: false |
Wed Jan 18 02:50:17 PST 2017 INFO: Email Receipts: true |
Wed Jan 18 02:50:17 PST 2017 INFO: Error Notifications: true |
Wed Jan 18 02:50:17 PST 2017 INFO: Debugging: true |
Wed Jan 18 02:50:17 PST 2017 INFO: Top level Name: GmailDelaySend |
Wed Jan 18 02:50:17 PST 2017 INFO: Label Required: true |
Wed Jan 18 02:50:17 PST 2017 INFO: Error Label Name: GmailDelaySend/Errors |
Wed Jan 18 02:50:17 PST 2017 INFO: To Send Label Name: GmailDelaySend/ToSend |
Wed Jan 18 02:50:17 PST 2017 INFO: Trigger Minutes: 10 |
Wed Jan 18 02:50:17 PST 2017 INFO: Delim: @ |
Wed Jan 18 02:50:17 PST 2017 INFO: TimeZone: Europe/Berlin |
Wed Jan 18 02:50:17 PST 2017 INFO: getHTMLRegex: /^([\s\S]*?>)([^<]+)(<[\s\S]*)/ |
Wed Jan 18 02:50:17 PST 2017 INFO: getTextRegex: /^\s*@([^<]*)(<[\s\S]*)/ |
Wed Jan 18 02:50:17 PST 2017 INFO: ------------ |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache miss |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache hit |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache hit |
Wed Jan 18 02:50:17 PST 2017 INFO: Searching for emails with this string: " label:GmailDelaySend/ToSend -label:GmailDelaySend/Errors " |
Wed Jan 18 02:50:17 PST 2017 INFO: Found 1 threads to process |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache miss |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache miss |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache miss |
Wed Jan 18 02:50:17 PST 2017 INFO: User timezone:Europe/Berlin |
Wed Jan 18 02:50:17 PST 2017 INFO: Converted:Wed Jan 18 2017 02:50:02 GMT-0800 (PST) to user time:Wed Jan 18 2017 11:50:02 GMT-0800 (PST) |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache miss |
Wed Jan 18 02:50:17 PST 2017 INFO: Is HTML email:false |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache miss |
Wed Jan 18 02:50:17 PST 2017 INFO: Parsing date and body from email with regex:/^\s*@([^<]*)(<[\s\S]*)/ |
Wed Jan 18 02:50:17 PST 2017 INFO: Empty Matches |
Wed Jan 18 02:50:17 PST 2017 INFO: Returning date_string: null |
Wed Jan 18 02:50:17 PST 2017 INFO: The message was malformed in some way. Found delimeter:false. Successful date parse: false |
Wed Jan 18 02:50:17 PST 2017 INFO: Processing message as error because user requires a label |
Wed Jan 18 02:50:17 PST 2017 INFO: Succesfully found label: GmailDelaySend/Errors |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache miss |
Wed Jan 18 02:50:17 PST 2017 INFO: Service cache miss |
Wed Jan 18 02:50:17 PST 2017 INFO: Successfully added label (GmailDelaySend/Errors) to message with subject: Test delay send |
Wed Jan 18 02:50:17 PST 2017 INFO: Removing label |
Wed Jan 18 02:50:18 PST 2017 INFO: Service cache miss |
--
You received this message because you are subscribed to the Google Groups "GmailDelaySend" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gmaildelaysen...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GmailDelaySend" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gmaildelaysend+unsubscribe@googlegroups.com.
Alex, I'm not going to be much help fixing what you are doing, but I have had no problem using !@! followed by the date, like !@!2017/01/17 1:20 AM.
I haven't tried"now" because if I wanted to send it now I would send it now.
To unsubscribe from this group and stop receiving emails from it, send an email to gmaildelaysend+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "GmailDelaySend" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gmaildelaysend+unsubscribe@googlegroups.com.
Hello Alex,Thanks for the excellent logs and help debugging.Just to explain the '<' stuff very quickly. When the script accesses the draft email, if the email is HTML it also sees that. So all that is in an attempt to use a regex and account for the HTML leading trailing chars.Could you do the same test, but write a plain text email?
Also, the logs suggest me that the regexp used is the "plain text one", not the HTML one:
(...)
Thu Jan 19 09:58:46 PST 2017 INFO: getHTMLRegex: /^([\s\S]*?>)([^<]+)(<[\s\S]*)/ |
Thu Jan 19 09:58:46 PST 2017 INFO: getTextRegex: /^\s*@([^<]*)(<[\s\S]*)/ (...) Thu Jan 19 09:58:47 PST 2017 INFO: Parsing date and body from email with regex:/^\s*@([^<]*)(<[\s\S]*)/ |
Thanks,-Blair
To unsubscribe from this group and stop receiving emails from it, send an email to gmaildelaysen...@googlegroups.com.
Then composing a text email which contains:function printDraftEmail() {Logger.log("Body of email: " + GmailApp.getDraftMessages()[0].getBody());}
The first line
The second line
The first line
Without any HTML, which is consistent with what you had seen. But I could have sworn that there used to be some HTML chars in there (yes, I know, it would be un-expected when the email is a text email).The second line
To unsubscribe from this group and stop receiving emails from it, send an email to gmaildelaysend+unsubscribe@googlegroups.com.