fix(plugins): more fixes to open/link tracking urls

This commit is contained in:
Drew Regitsky 2016-02-24 12:17:39 -08:00
parent feabd96f86
commit 29f751e1ce
2 changed files with 2 additions and 2 deletions

View file

@ -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;
});

View file

@ -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;