GMail API: Trashing first email seems to remove entire thread - go

I'm using the GMail API in Go(lang). After each email arrives I am 'inserting' (not sending an email onto the same thread (with stats about how many times you have communicated with this person etc etc...
What I want to end up with is the original incoming email trashed, and the inserted email first in the thread. The content of the original email is appended to the inserted email.
All works, except that when I trash the email with the ID of the original email, the entire thread disappears.
Is this because the appended email is inserted and not 'sent' to the thread? I wouldn't have thought so because it gets given a real messageID, so is it because I am trashing the first email in a thread, and that therefore trashes the whole thread?
I thought trashing should just trash the message, regardless of its 'ownership' of the thread.
Thanks

You may refer with this post although the issue here is to retrieve the specific email within a thread. It stated that it is not currently possible because it is part of the email's body content and you're specifying the ID of the message to trash. You can only trash other messages within a thread, but not the primary message since the messageId and the threadId of the first email is the same. Yes, using the Gmail App it's working, but I think it is not yet supported using the API. You can file a feature request for this.

Related

Can i put hidden token inside email while sending email through laravel

I want to send a email to the user from my laravel application. But i want to add a hidden token in that email so that user cannot see it and when user reply to that mail i can read that token and further use it.
Is it even possible?
I am using laravel 5.6 and sending emails using SMTP
There are several ways to do it but none is ideal. Let's start with your idea:
You can add a token within the message, but it can never be invisible, the contents of the message have to be fully visible. Even so, if the reply simply doesn't contain the original message, you will lose the reference
The standard way of tracking replies is based on Message-ID, since every email has to have unique Message-ID. Since you mentioned that you are using SMTP, that allows you to setup Message-ID upfront, otherwise, you'd retrieve it after the message is sent. It helps in a way that you can store that value in the database and automatically link it to the recipient.
Then, you'd look for In-Reply-To: and/or References: headers which should mention the original Message-ID if the reply is properly formatted, which doesn't have to be the case.
Ultimately, depending on your use case, you might not need any of these and you could just keep the sent email based on the recipient email address and extra information that you wanted to pass in the email within your database. Assuming that you'd expect an email from the same recipient email address, you could just figure out the token locally.

How to get conversation id if we only have send-only permission of user outlook account?

Is it possible to get conversation id and message id of the messages sent by our app on behalf of the user who only given send only permission?
We want to send follow-up mails in the same conversation and there is no way we can do that without message id.
I'm afraid not. You need to have mail.read in order to find the message id and add to the conversation.
Also, it's important to note that the id is mutable and can change for any number of reasons (most commonly the mail item being moved to another folder). It is possible to get immutable identifiers for Outlook resources but this functionality is still in Preview so, for the time being, it really shouldn't be used in a production environment.

How can you quote the original in an email reply to a Yammer message?

I prefer the traditional non-top-posting style of replying to email messages - quote the original with "bird tracks" (which you can get automatically with almost every email app), cut out irrelevant content that I am not responding to, then intersperse my replies among the reply lines of the original. This gives a nice conversational feel to the reply, and makes it very clear exactly what I am referring to in the original for each of my points.
But my company has now started using Yammer, and I am in a bind. I tried one of my signature non-top-posting replies to a Yammer message I received via email from a colleague. Yammer deleted almost the entire text of my reply, from the first line of quoted text onward, including all of my responses from that point on.
I tried changing the bird tracks to asterisks and reposting. Same effect.
Finally I posted the reply (the asterisks version) via the Yammer web interface, and that worked.
But I don't want to have to switch to the web interface, or a specialized desktop app, every time I need to respond to a Yammer message. Is there any way to stop Yammer from deleting all quoted text, and all other text that follows it, from email responses to Yammer messages?

Is it possible to add a 'pending' subscriber to Mailchimp via the API?

Here's what I'd like to do:
User completes sign up form on my app
My app sends the input data (email address, name, etc) to Mailchimp via the API, but with a status of 'pending'
My app sends an email to the user asking them to confirm their email address (essentially emulating the Mailchimp confirmation email)
User clicks link in confirmation email, which takes them back to a confirmation page in my app
My app updates the user's status in Mailchimp to 'subscribed' via the API
Essentially, I want to emulate Mailchimps standard confirmation process, but sending the emails from my own app.
The part that I don't know how to do (or don't know if it's possible) is the part where I add a new subscriber with a status of 'pending'.
Here's some further info that's not strictly relevant but may be of interest...
Why don't I just use the standard Mailchimp confirmation email?
The confirmation email needs to contain extra info, unique to each user, that Mailchimp will not have access to.
Why don't I collect all the data locally and then send it all to Mailchimp once the user has confirmed their email address?
For reasons I won't go into, the number and type of required fields will be unknown. At the point when the sign up form is displayed, I will request the list of fields from Mailchimp and display the necessary fields. It is possible that, between the time when the user initially completes the form and the time when the user confirms via email, the required fields will have been changed. If I try to submit the previously collected data to Mailchimp after the required fields have been changed, it will cause an error.
So I need to collect and submit all data to Mailchimp at the same time. And then simply 'switch on' that user in Mailchimp once (s)he has confirmed.
I hope I've provided enough info. If not, happy to provide more or clarify any points.
Thanks!
The internal "pending" status is not able to be managed manually like that. You can subscribe them using double opt-in and then later force them onto the "subscribed" list, but you can't stop them from getting MailChimp's own confirmation email.
One possible work-around would be to add an interest group or merge field that is populated by your system once you've confirmed the email address. You'd then create a saved segment for only confirmed users and make sure you only ever send to that segment and never the whole list.
Another possibility, if you use API v3.0 (which is currently only in beta), is to add them to your list as unsubscribed and then switch their status to "subscribed" once you've confirmed them. If you do this, be very careful that you're not re-subscribing users who unsubscribed or you could wind up in trouble.
This workflow is definitely 100% possible in the current (V3) of the API. Just set the "status" field on a member to "pending" and then to "subscribed".

How does the CRM Email router set the RegardingObjectId on incoming emails

We have a system setup where complaints from a website form are emailed to an address and subsequently picked up by the email router and placed in a queue. Users then create a case from these emails (custom code create the case and populates it based on the email content and the queue it arrived into)
Some of the emails are coming in and the regarding object is set to an existing case even though the email and the case are not related. My guess is that this is something to do with the fact that the emails are coming into the queue from the same web address (complaints#abc.com)
Can somebody explain to me the criteria the email router uses for setting the regarding object of an incoming email
Thanks,
Neil
Looks like you are another "victim" of a feature called Smart Matching. For info on what that is and how to disable it, look here.

Resources