Does anyone know why this code appears on all of the emails sent? It's appearing as a broken image in Outlook -- which is a problem for us. I'm assuming it's potentially something related to tracking or statistics.
I need to either make it invisible or remove it so it doesn't appear as a broken image on emails.
Running:
Umbraco 7.5.7
Umbraco Forms 4.4.0
PerplexMail 2016-11-02
Any help is appreciated! Thank you
Edit
It does appear this is related to statistics per the documentation. I'm not sure how to get it to appear as anything other than a broken image in emails.
A bit more testing into this...
The image loads fine straight away without any query strings. However, the mailer code is inserting these with query strings for tracking purposes. If I wasn't getting a server error I wouldn't end up with what appears as a broken image and it'd be transparent to end users -- pretty slick.
The error appears to be a conflict with Umbraco trying to handle images with query strings via ImageProcessor.
If I determine a fix, I'll post back.
Edit:
The fix is to append "ipignore=true" to the query string of the url as so:
http://{your domain name goes here}.com/App_Plugins/PerplexMail/s.gif?i=14&a=view&ipignore=true
I'll probably run a custom build of the dll for the moment, but I'll try and submit a pull request to fix the issue.
Edit2: Not sure how this should best be added to the image. I'm going to skip the pull request; I'm assuming this is also fixable with a IIS Rewrite rule. I did dig into the ImageProcessor library and they don't have an "exclude" or "ignore" setting anywhere that I can see.
sorry for the late reply but the image is added because of tracking purposes. It's a single pixel that when it's get loaded update the statistics tab that somebody has opened this e-mail.
We forgot to add this to the documentation (will do soon hopefully), but one way of getting rid of the error is by cancelling this request to go through ImageProcessor. This can be done to add this to the Global.asax.cs
private void ImageProcessingModule_ValidatingRequest(object sender, ImageProcessor.Web.Helpers.ValidatingRequestEventArgs e)
{
if (!string.IsNullOrWhiteSpace(e.QueryString))
{
// When we encounter the s.gif, skip the image processing module to prevent the error
if (e?.Context?.Request?.FilePath == "/App_Plugins/PerplexMail/s.gif")
{
e.Cancel = true;
return;
}
}
}
In modern Umbraco apps, you need to create a class that inherits from ApplicationEventHandler.
For example, I made a class called RegisterEvents and put it in an 'Events' folder in the root of my project. In this class, you can override the ApplicationStarting event that Jeffrey mentions in his post. It will look something like this:
public class RegisterEvents : ApplicationEventHandler
{
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
ImageProcessingModule.ValidatingRequest += ImageProcessingModule_ValidatingRequest;
base.ApplicationStarting(umbracoApplication, applicationContext);
}
private void ImageProcessingModule_ValidatingRequest(object sender, ImageProcessor.Web.Helpers.ValidatingRequestEventArgs e)
{
if (string.IsNullOrWhiteSpace(e.QueryString)) return;
// When we encounter the s.gif, skip the image processing module to prevent the error
if (e?.Context?.Request?.FilePath == "/App_Plugins/PerplexMail/s.gif")
{
e.Cancel = true;
}
}
}
"s.gif" appearing on all emails sent?
Does anyone know why this code appears on all of the emails sent? It's appearing as a broken image in Outlook -- which is a problem for us. I'm assuming it's potentially something related to tracking or statistics.
Looks like this:
I need to either make it invisible or remove it so it doesn't appear as a broken image on emails.
Running:
Any help is appreciated! Thank you
Edit
It does appear this is related to statistics per the documentation. I'm not sure how to get it to appear as anything other than a broken image in emails.
A bit more testing into this... The image loads fine straight away without any query strings. However, the mailer code is inserting these with query strings for tracking purposes. If I wasn't getting a server error I wouldn't end up with what appears as a broken image and it'd be transparent to end users -- pretty slick.
The error appears to be a conflict with Umbraco trying to handle images with query strings via ImageProcessor.
If I determine a fix, I'll post back.
Edit: The fix is to append "ipignore=true" to the query string of the url as so:
I'll probably run a custom build of the dll for the moment, but I'll try and submit a pull request to fix the issue.
Edit2: Not sure how this should best be added to the image. I'm going to skip the pull request; I'm assuming this is also fixable with a IIS Rewrite rule. I did dig into the ImageProcessor library and they don't have an "exclude" or "ignore" setting anywhere that I can see.
Couldn't get this to work with IIS rewrite rules, but I created a pull request for this.
https://github.com/PerplexInternetmarketing/PerplexMail-for-Umbraco/pull/2
Hi guys,
sorry for the late reply but the image is added because of tracking purposes. It's a single pixel that when it's get loaded update the statistics tab that somebody has opened this e-mail.
We forgot to add this to the documentation (will do soon hopefully), but one way of getting rid of the error is by cancelling this request to go through ImageProcessor. This can be done to add this to the Global.asax.cs
And this
This will prevent ImageProcessor kicking in.
Hope this helps,
Jeffrey
Hi Jeffery,
Finally getting back to this now that I have time. In my project, all I have is "Global.asax" without the associated "Global.asax.cs" class.
It's contains:
Any idea how I get that .cs class added in and what I need to change the existing Global.asax code to be to link up?
Thanks, Chris
Hi, Chris.
In modern Umbraco apps, you need to create a class that inherits from
ApplicationEventHandler
.For example, I made a class called
RegisterEvents
and put it in an 'Events' folder in the root of my project. In this class, you can override theApplicationStarting
event that Jeffrey mentions in his post. It will look something like this:is working on a reply...