Skip to content

Commit

Permalink
Allow special chars in email titles
Browse files Browse the repository at this point in the history
Fixes #35
  • Loading branch information
dpoeschl committed Dec 7, 2015
1 parent 0147ff2 commit 69acfda
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,12 @@ function sendmultimail(issuesList, isPull) {
shortBody = shortBody + "Notice: This message contains information about a private repository."
}

var finalFullMailToUrl = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body);
var finalShortMailToUrl = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(shortBody);
var decodedSubject = $('<div/>').html(subject).text();
var decodedBody = $('<div/>').html(body).text();
var decodedShortBody = $('<div/>').html(shortBody).text();

var finalFullMailToUrl = "mailto:?subject=" + encodeURIComponent(decodedSubject) + "&body=" + encodeURIComponent(decodedBody);
var finalShortMailToUrl = "mailto:?subject=" + encodeURIComponent(decodedSubject) + "&body=" + encodeURIComponent(decodedShortBody);

if (finalFullMailToUrl.length <= 2083) {
window.location.href = finalFullMailToUrl;
Expand Down Expand Up @@ -982,5 +986,7 @@ function sendmail(issueNumber, issueTitle, isPull) {
body = body + "Notice: This message contains information about a private repository."
}

window.location.href = "mailto:?subject=" + encodeURI(subject) + "&body=" + encodeURI(body);
var decodedSubject = $('<div/>').html(subject).text();
var decodedBody = $('<div/>').html(body).text();
window.location.href = "mailto:?subject=" + encodeURIComponent(decodedSubject) + "&body=" + encodeURIComponent(decodedBody);
}

0 comments on commit 69acfda

Please sign in to comment.