mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-17 18:14:53 +08:00
fix(plugins): more fixes to open/link tracking urls
This commit is contained in:
parent
feabd96f86
commit
29f751e1ce
2 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ export default class LinkTrackingComposerExtension extends ComposerExtension {
|
|||
// loop through all <a href> elements, replace with redirect links and save mappings
|
||||
draftBody.unquoted = draftBody.unquoted.replace(RegExpUtils.linkTagRegex(), (match, prefix, url, suffix, content, closingTag) => {
|
||||
const encoded = encodeURIComponent(url);
|
||||
const redirectUrl = `http://${PLUGIN_URL}/link/${draft.accountId}/${messageUid}/${links.length}?redirect=${encoded}`;
|
||||
const redirectUrl = `${PLUGIN_URL}/link/${draft.accountId}/${messageUid}/${links.length}?redirect=${encoded}`;
|
||||
links.push({url: url, click_count: 0, click_data: [], redirect_url: redirectUrl});
|
||||
return prefix + redirectUrl + suffix + content + closingTag;
|
||||
});
|
||||
|
|
|
@ -21,7 +21,7 @@ export default class OpenTrackingComposerExtension extends ComposerExtension {
|
|||
const uid = uuid.v4().replace(/-/g, "");
|
||||
|
||||
// insert a tracking pixel <img> into the message
|
||||
const serverUrl = `http://${PLUGIN_URL}/open/${draft.accountId}/${uid}`;
|
||||
const serverUrl = `${PLUGIN_URL}/open/${draft.accountId}/${uid}`;
|
||||
const img = `<img width="0" height="0" style="border:0; width:0; height:0;" src="${serverUrl}">`;
|
||||
const draftBody = new DraftBody(draft);
|
||||
draftBody.unquoted = draftBody.unquoted + "<br>" + img;
|
||||
|
|
Loading…
Add table
Reference in a new issue