Not able to get full message body using Gmail API in JavaScript - javascript

There are many similar questions here, but none of them matches my concern.
I am giving the "FULL FORMAT" in endpoint, as mentioned in documentation, But still I get 1-2 lines of message body. I want to get all the text written in email. It gives me 25-40 words in "Snippet" key name in respond. How can I get the whole message?
Thank you!!!

Related

Get MIME mail content in Outlook Addin via Graph

I am trying to create an outlook addin, that reads the selected mail in .MSG or .EML format. I found a
Stackoverflow Question with a link to this documentation how to read a mail from Graph: https://learn.microsoft.com/en-us/graph/outlook-get-mime-message. I tried to use https://graph.microsoft.com/v1.0/me/messages/{id}/$value with the Graph tester. I entered all ids i could find in the Office.context.mailbox.item but none of them gave me a valid result. So where do I have to take the id from, the Graph Tester needs?
I found that: Office.context.mailbox.item.itemId.replace('/', '-').replace('+', '_'); gets the same id, the graph gives when asking for all messages via https://graph.microsoft.com/v1.0/me/messages. I just do not know why I have to replace chars in the id.

Reading emails through javaMail library with Mirth Connect

My goal is to read emails(and possibly mark them as read in the inbox) through Mirth Connect channels. I found this Reading mail from open source Mirthconnect question about the issue. Oddly the person asking answered the question. When I tried to implement the code he provided with my specifications such as instead of gmail outlook inbox(no problems here) the channel called out error:
64DETAILS:
TypeError: Cannot find function getBodyPart in object <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi!</div>...(here the email continues with div tags)
So I clearly get the email data but getBodyPart breaks it. What I understood from this is that his code was meant for specific kind of emails and I guess I received an non-mime email in the example here.
So it seems what I am asking: How do I create a reader that translates all mail into plain text and then output it into the logger/other output so I can manage it?
Management would mean something like spreading specifically titled mail into different channels and mark them read in the inbox they came from.
I hope I'm clear enough with my question and follow the rules of asking questions.
I am answering to your updated query.This program will be reading the email repeatedly as you mentioned is correct so as to avoid this after reading you need to move the email to other folder and also you can customise your program to read from particular email sender or based on subject so that it reads only your particular email and you can move that email to you wished folder.
I was the one whom you mentioned in the code. When I tried to fetch the mail from GMAIL also I faced the same issue. But I checked the security apps OFF, I have provided the link here for GMAIL. I guess something like this must be available for outlook as well. But I have tried the same code to read in my outlook it worked fine without any changes been made (not sure how?).
For GMAIL Security OFF
https://myaccount.google.com/lesssecureapps
It depends on the kind of mail your are reading. In my case I was getting HTML designed data in the body of the mail.That code was not generalized one. It is supposed to read HTML data in mail body.I'm not sure how your mail is?. But mp.getBodyPart(0) or mp.getBodyPart(1) should provide some output. Even if you attach the file in the mail, mp.getBodyPart will read the attachment.

Send message to Slack channel when Google Sheet column gets updated (Google Script)

I'm trying to connect my Google Sheet with a Slack Channel. The use case is as follow:
I have a Google Sheet which looks like this:
There are around 50 so called topics, each of them has internal and external experts listed, also some related files. For now, only the internal experts column of each topic is of interest. Whenever a new person is listed as an internal expert (new cell on the bottom of the column), I want to send out a message to a related slack channel which looks like this:
The message should contain the name or content of the added cell and the name of the Topic he/she was added in as an internal expert (in this case "Topic 1"). The rest is a predefined string. As you can see, I tried to do this with Zapier, and it works. The problem is with Zapier, there seem to be too many limitations when working with several columns. As far as I know, I would have to create a separate Zapier Action for each column, which isn't a really nice solution.
Does anybody can give me a hint how to build this with a Google Script (+ Slack Webhook)? Or if it even makes sense to do so? I'm not an expert in JavaScript + datasets, so I'm struggling a bit on how to start this.
I would suggest to take a look at Triggers for Google App Scripts. You can set a trigger to run every time your Google sheet is edited - see onEdit(). Your trigger can than check if the edit is relevant (e.g. new cell at the bottom of a specific column) and send a request to Slack using incoming webhooks.

Getting email headers from within an HTML email for tracking purpose

Posting question in StackExchange for first time. Apologies if this has issues...
Need to track email open.
This is something not very new and the approach generally used is to have a pixel in the HTML which calls a server URL asynchronously. By using this we get the number of opens for an email.
Now the issue is the email is send to a Distribution List (DL) and we have a requirement to track email open and also clearly state who has opened it..
Basically when a hit to server comes, it should says xxxx#mail.com has opened this email.
In my HTML if i have a way by whcih to capture the email headers, my requirement would be sorted... I would use Javascript to get the email headers and then when i call the server URL i will send across the details...
When i searched i found a POST which was doing something similar...
Read email headers in Outlook Web Access (OWA)
But this was for office application...
Also, i am not sure whether this would even work...
Any pointers is well appreciated....
I am specifically at the moment looking for exchange server...
In my HTML if i have a way by whcih to capture the email headers
You don't.
I would use Javascript to get the email headers
You can't run JavaScript in an HTML formatted email
The only identifying information you can get back from the email is the information you put it in it in the first place.
You can put a unique ID in a tracking pixel (increasing the chances of it being marked as spam) but that ID will be given to anyone who gets a copy of the email (including if it is forwarded automatically by a mailing list or manually by a reader). The tracking will also fire only if the image is loaded from the server (plenty of people keep email image loading turned off).
There is no way to find out who your email actually ended up with.

How to verify a new email address is correct in ColdFusion

I have a holiday website I built years ago in ColdFusion. I'm not the best programmer so I enlisted the help of a senior programmer to do the "heavy lifting." Unfortunately, he is not available at this time.
QUESTION:
On the site, there is a form for kids to email Santa. In an effort to get them to come back, I send them a "Secret Passcode" they can use to come back to the site the next day to get Santa's response (Santa is super busy this time of year and can't respond instantly - more realistic.) I collect their email, first name and "wish list" info and stuff it into a DB.
The problem I'm having is that a reasonable percentage of kids/parents mistype their email address (e.g. suzy#gmial.com vs suzy#gmail.com) causing them to never get their "Secret Passcode" or hear back from the North Pole at all! This, of course, could be challenging for Santa believers wondering why Santa never got back to them.
Is there a way to do a real time check to see if the email address is valid BEFORE entering it into the DB, and toss up a response page stating "The email address you entered is not valid. Please check that you spelled it correctly" or something similar.
~ North Pole Needs Your Help.
Have you tried using mailcheck? It's a Javascript library and jQuery plugin that suggests a right domain when your users misspell it in an email address. The developers of the script claim it has reduced their sign up confirmation email bounces by 50%. There are instructions available for jQuery & non-jQuery usage.
https://github.com/mailcheck/mailcheck
Check out the live demo here (and enter "suzy#gmial.com").
http://kicksend.com/join
You'll need to perform server-side validation using ColdFusion before you use CFMail or the user will get a visible error. Use isvalid("email", Form.Email) to determine if the address is valid.
And now it's up to me to disappoint Santa? Oh, my...
It is not possible.
You cannot check for typos. Example? Your example: gmial.com is valid.
You can do a rough check one of more characters followed by an # sign followed by two or more characters followed by a dot followed by two or more characters There are a lot of regular expression to be found online, just ask Google for "regular expression email javascript". Please choose a simple one.
The only thing is hoping that the email-sending process is fast and add a line or two to ask them to check their email and if there is nothing in it in a minute or two they have to check if their email is correct. You may have the password-input on the same page they send you their data, to raise the chance they keep that page open.

Categories

Resources