Fix Gmail Actions
In relation to https://github.com/gitlabhq/gitlabhq/blob/master/doc/integration/gitlab_buttons_in_gmail.md & http://feedback.gitlab.com/forums/176466-general/suggestions/6534681-add-view-pull-request-buttons-for-gmail it looks like there may be some problems with the email markup/Gmail actions that may be causing Google's rejection of the schema whitelisting.
GitLab footer:
<div class=3D'footer' style=3D'margin-top: 10px;'>
<p>
=E2=80=94
<br>
<a href=3D"https://gitlab.com/gitlab-org/gitlab-development-kit/merge_req=
uests/54#note_1111544">View it on GitLab</a>
<script type=3D"application/ld+json">{"@context":"http://schema.org","@ty=
pe":"EmailMessage","action":{"@type":"ViewAction","name":"View Merge requ=
est","url":"https://gitlab.com/gitlab-org/gitlab-development-kit/merge_re=
quests/54#note_1111544"}}</script>
You're receiving this notification because you are a member of the GitLab=
.org / GitLab Development Kit project team.
</p>
</div>
GitHub footer:
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href="https://github.com/OneBusAway/onebusaway-iphone/pull/418#issuecomment-96448442">view it on GitHub</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABIzTFhXRPJLm54dMx-vyWsOQ56dS9oZks5oDW6agaJpZM4EIoiH.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/OneBusAway/onebusaway-iphone/pull/418#issuecomment-96448442"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>
Per https://developers.google.com/gmail/markup/reference/go-to-action Json-Ld and Microdata formats are both acceptable but I'm wondering if Google has a problem with the "3D"s showing up before the single and double quote marks as well as the line truncation method.
If you take the exact text from above and paste it at https://www.google.com/webmasters/markup-tester/u/0/ GitHub's passes but GitLab's does not.
Since Gmail is displaying the emails properly theoretically Gmail is processing them correctly but I'm just guessing as to potential problems. Has anyone been able to attempt to send schemas to themselves from GitLab and seen if it works (see https://developers.google.com/gmail/markup/registering-with-google)... I'm having issues getting my dev environment to send emails so have been unable to test.
-
Added bug label
-
/cc @marin
-
@marin Can you look into this?
-
@bbodenmiller when this was developed few versions ago I had it working correctly on the dev environment, actions showed up in my test inbox and all the checks passed, so I don't know if something changed in the meantime. If you check the rake task, it generates the email with dummy data that gets sent for whitelisting.
My suspicion was that the dummy email was the issue as I got asked if the email was sent from the production server. This was the case but the data was not real to prevent user data exposure.
BTW, setting up environment to try this out is a very big hassle so you will need some patience to get it up and running.
-
@marin can you remove all dummy date from GitLab completely (to prevent anyone submitting dummy data again or having the suspicion that we used dummy data) and generate an email based on production data? I think we should try again.
-
@sytses If I remove dummy data I can remove the whole rake task as it is built around the dummy data. Updating the task will mean rewriting it completely. It can be done when attempting this task again but keep in mind that setting up environment for this is extremely time consuming(unless something changed in the meantime ofcourse). Which one do you prefer?
-
@marin Can we just enable structured text emails in 7.14 for everyone and remove the rake task?
-
Can we just enable structured text emails in 7.14 for everyone
If this means removing the plain text emails and only have structured text emails then a new issue might be a better place for this discussion.
and remove the rake task
Rake task can be removed even now in my opinion as it doesn't bring anything useful and might even create issues for users.
-
@sytses No but I was confused with your question as we already have the google required stuff in our emails.
-
@marin OK, can we just send one of these emails to Google then?
And OK to remove the rake task.
-
@sytses Some work still needs to be done as it seems that something broke the rendering of the required data like Ben mentioned at the description of this issue.
I can add this to my TODO list if you think we should try applying again during 7.14 milestone.
Edited -
@marin Yes, I think we should try that. This feature would be awesome to have.
-
Reassigned to @marin
-
At the moment I am trying to understand why some emails get rendered properly and some emails have the html escaped which will cause equal to be escaped, eg.
<div class=3D'content'>.After some investigation I am suspecting the issue to be at
Content-Transfer-Encodingwhich gets set toquoted-printableby default. github emails are forced to7-bit.On a test machine I have setup, forcing this on all emails made a change but on a production machine that doesn't seem to be the case.
At the moment I am just trying to see how to go around it because
7-bitdoesn't seem like something we could use due to ourEmails on pushservice and the limitation7-bitbrings in the form of maximum number of characters(1000).Some nice info about content transfer encoding I found on this SO article.
Edited -
Well this is/was interesting. I found a character in
layout/notify.htmlthat I suspect caused the breakage for the mails rendering. This line in notify.html is not a backslash dash but it is\�~@~T.After I've replaced that line the email gets rendered without escaping and email markup passes.
-
@marin wow, interesting indeed
-
@marin I expect issue with Chinese text on Dev.gitlab.org now :)
-
@sytses :)
That already happened and the results are (sadly) expected. The
Content-Transfer-Encodinggot set toquoted-printableand the output of the email looks broken:----==_mimepart_55ae4f796e99_1a8f5842b0876c8 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Marin pushed to branch master at Marin / GitLab Commits: e043265a by Marin Jankovski at 2015-07-21T13:56:07Z ee? - - - - - 1 changed file: - README.md Changes: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D README.md =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DNow I need to go back to (more) reading.
Edited -
@marin OK
-
After some more investigation it looks like this is a situation which cannot be easily fixed(if it can be fixed at all).
However, I do not think it is even required to fix it for cases where there are non-ascii characters. Looking at some other emails I received it is expected to receive an email with 7bit content-transfer-encoding with ascii chars and quoted-printable when there are some non-ascii chars.
What I will do now is:
- Change the char that caused the failures on all emails => In !1024
- remove the rake task and the doc pointing to the rake task => !1024
- Go through the required steps from the google documentation and confirm all is in order
- prepare a new request and apply
- reconsider how to radiate this information for other GitLab users(maybe only document the process)
-
mentioned in merge request !1024
-
I wanted to avoid setting up the environment in which to test this by using the tip from registering doc:
All schemas you send to yourself (from x@gmail.com to x@gmail.com) will be displayed in Google products.
This is plain not true. Email sent this way won't be signed by DKIM and the action won't be shown.
Sadly, I will have to go through setting up the whole environment for this once again :/
-
@sytses I would need admin access for email account used in dev.gitlab.org and possibly to the DNS settings of dev.gitlab.org so not sure how easier that would be considering I might interrupt work during release for everyone
-
@marin OK, glad to hear it is going faster this time
-
The environment is up and running, the emails get sent with the expected headers and pass the spf and dkim check. However, The emails also pass the email markup check but at the moment the emails I receive on the account are not showing the button.
At the moment I am debugging why this is the case.
-
@marin Yay!
-
mentioned in merge request !1024
-
mentioned in commit b7be08c5
-
@bbodenmiller We haven't applied yet. I will update this issue once I do that.
-
agreed on 8.0 with @marin
-
@marin Can you look into this one again? Is it listed for any next patch release?
-
@sytses I need to handle bureaucracy behind it and apply with google. Hope to have this ready to send this week.
-
Due to our internal infrastructure work that is blocking the task I was working at I can move this to the top of my todo list.
The Google Registering procedure is laid out in google developer docs.
Edited -
- Emails must be authenticated via DKIM or SPF
From current email:
EditedAuthentication-Results: mx.google.com; spf=pass (google.com: domain of bounce+cd3a2c.947b4-marin=gitlab.com@mg.gitlab.com designates 198.61.254.240 as permitted sender) smtp.mailfrom=bounce+cd3a2c.947b4-marin=gitlab.com@mg.gitlab.com; dkim=pass header.i=@mg.gitlab.com -
- The top-level domain (TLD) of the SPF check or DKIM signature must match the TLD of your From: email address.
e.g. if you use From: foo@bar.com the DKIM or SPF must be for bar.com or sub.bar.com
We send email from
Editedgitlab AT gitlab.comand our dkim and spf are frommg.gitlab.com. -
- Emails must follow the Gmail Bulk Sender Guidelines
We are not sending emails in bulk directly, we send it one by one to mailgun. After that it is handled by mailgun.
Edited -
- Consistent history of sending a high volume of mail from your domain (order of hundred emails a day minimum to Gmail) for a few weeks at least.
Need to check if I can find this out. => Confirmed in this comment
Edited -
- A very very low rate of spam complaints from users.
Don't know how to check this, possibly when I get access to mailgun. Also, this doesn't say much, is 1k low on 100k sent emails ??
=>
Edited -
- The highest-fidelity action available should be used. For example, if an interaction can be achieved by an In-App Action (One-Click, RSVP, Review), that must be used. For more complex interactions, Go-To Actions can be used.
Examples of actions are shown in this doc.
- One-Click Action => Not applicable to us as our actions are not to approve, confirm and acknowledge something
- RSVP Action => Not applicable
- Review action => Not applicable
- Go To action => We want this because we need to take the user to the comment user received for Commit, Merge request or Issue.
-
- Go-To Actions:
Must deep link into the specific page on which the action can be performed.
Url will look like
https://gitlab.com/gitlab-org/gitlab-ce/issues/2446#note_2064826Label of button needs to reflect clear action to be taken and must be true to page the user is going to. Label of action should not contain punctuation or all caps. Must be short and concise.
The label will show
View Issue,View Merge requestorView Commit.We are currently only approving Go-To actions for very specific high-value usecase with high interaction rate (e.g. Flight Check-in, Shipment tracking links).
I hope they approve us.
Low failure rate and fast response for services handling Action Requests.
We try to keep GitLab.com online.
Edited -
https://www.google.com/webmasters/markup-tester/u/0/ shows no errors when an email from GitLab.com is inserted in the tester.
-
After I confirm that the 2 remaining checkboxes are fine, I need to submit a request using this Google Form.
I need to submit the form 3 times, because we are applying for Issue, Merge Request and Commit.
-
Listing what I will input in certain fields:
- What does your company do? What is its main goal or product? *
GitLab.com is a free git repository hosting service. GitLab.com is a SaaS that runs GitLab Enterprise Edition which is a superset of open-source GitLab Community Edition. GitLab.com offers unlimited private and public repositories for an unlimited number of public or private collaborators, completely free of charge.
- Describe the email to which you plan to add schema. What is its purpose?
For Issues:
Project can have multiple collaborators. Each collaborator can participate in a discussion in an Issue, Merge request or Commit. Collaborator can decide to follow or not follow discussions by setting preference in their user profile. If they chose to follow discussions, they can participate in a discussion by commenting or by being mentioned in the discussion. Collaborartor can also choose to receive notifications in an Issue where they are not mentioned by subscribing to receive email notifications. Similarly, they can opt out of receiving notification for an Issue where they are a collaborator. Depending on the user-set preference as explained above, collaborator will receive an email notification for discussions. Email notification sent to the collaborator will contain the latest comment that triggered the notification. With the Gmail Action, collaborator should receive the email with Go-To action with label "View Issue". "View Issue" has a link that takes the collaborator directly to the comment that triggered the notification.For Merge requests:
Project can have multiple collaborators. Each collaborator can participate in a discussion in an Issue, Merge request or Commit. Collaborator can decide to follow or not follow discussions by setting preference in their user profile. If they chose to follow discussions, they can participate in a discussion by commenting or by being mentioned in the discussion. Collaborator can also choose to receive notifications in a Merge request where they are not mentioned by subscribing to receive email notifications. Similarly, they can opt out of receiving notification for a Merge request where they are a collaborator. Depending on the user-set preference as explained above, collaborator will receive an email notification for discussions. Email notification sent to the collaborator will contain the latest comment that triggered the notification. With the Gmail Action, collaborator should receive the email with Go-To action with label "View Merge Request". "View Merge Request" has a link that takes the collaborator directly to the comment that triggered the notification.For Commit:
EditedProject can have multiple collaborators. Each collaborator can participate in a discussion in an Issue, Merge request or Commit. Collaborator can decide to follow or not follow discussions by setting preference in their user profile. If they chose to follow discussions, they can participate in a discussion by commenting or by being mentioned in the discussion. Depending on the user-set preference as explained above, collaborator will receive an email notification for discussions. Email notification sent to the collaborator will contain the latest comment that triggered the notification. With the Gmail Action, collaborator should receive the email with Go-To action with label "View Commit". "View Commit" has a link that takes the collaborator directly to the comment that triggered the notification. -
send a real-life email coming from your production servers
I will use this issue for "View Issue" action.
I will use MR !1024 for "View Merge request" action.
I will use aee579ea (comment 2069770) for "View Commit"
Edited -
@marin Is all this code live on GitLab.com? (I got that idea from gitlab-org/gitlab-ee#9 (comment 2066925))
Edited -
@sytses Yes, looking at the registering guidelines all needed changes are already live.
-
Ok, I have access to mailgun so I am revisiting:
- A very very low rate of spam complaints from users.
We had 3 complaints for the past 30 days for several hundred thousand emails we've sent. Over the period of 6 months where we've sent several hundred thousand emails over one million we had 35 spam complaints. I would call this a very, very low rate of spam complaints. We also have an ongoing effort to make this even lower by adding user report option.
Edited -
- Consistent history of sending a high volume of mail from your domain (order of hundred emails a day minimum to Gmail) for a few weeks at least.
Daily we send anything between several thousand to a 13 thousand emails. Weekends being lower than workdays ofcourse. This has been the trend for the past 3 months at least. I would say we are fulfilling this easily too.
Edited -
@marin Great news! Where are the docs on how to enable this for on-premises again? So we can reference it in the 8.0 blog post.
-
@sytses There is some info in the docs but I should update it with more information according to this issue.
-
@marin thanks!
-
Nice! Don't forget to close http://feedback.gitlab.com/forums/176466-general/suggestions/6534681-add-view-pull-request-buttons-for-gmail
-
mentioned in merge request !1327
-
Status changed to closed by commit 26544eab
-
mentioned in commit 26544eab
-
That looks like a bug @bbodenmiller, can you raise a separate issue?
-
mentioned in issue #3014
-
mentioned in issue #3142
-
mentioned in issue #14624
-
Please register or sign in to post a comment




