Open tleyden opened 6 years ago
Looks like campaigns have been deprecated in favor of tagging
Looks like this code would need to set the o:tag
field, and that would need to be exposed to https://github.com/markhuge/mailgun-stream/, and then to this library.
If you could provide any more hints at implementing, I could try to put together a PR
@tleyden hey, sorry just saw this. Will review this after work today
Cool. I ended up just hacking my local version to add the tags I needed, but it's not a sustainable solution so it would be great to parameterize it.
In grunt-email-workflow/node_modules/mailgun-send/index.js
:
{
parse(data) {
.... snip ..
// detect content type
// TODO this should be its own method
var isHTML = function(str) { return /<[a-z][\s\S]*>/i.test(str); };
if (isHTML(body)) data.html = body;
else data.text = body;
data.subject = data.subject || this.subject;
data["o:tag"] = "MyTag" // <-- Temp hack
return data;
}
}
From http://blog.mailgun.com/mailgun-campaign-analytics-taking-analytics-beyond/:
With the
o:campaign
field, it will associate the email with a campaign for analytics purposes.