Comments (9)
Thanks for reporting this issue. We can probably provide a non-throwing implementation of the Browser property. Since an email is being generated does it matter if the Browser property does not reflect the actual current browser?
from postal.
To me, I do not think it matters. Working around this point, the email generates successfully, so I agree a pseudo Browser property would work. Maybe just returns 'Postal' :)?
from postal.
I'm interested to know more about how 51degrees is intercepting the Postal view rendering. Is it getting into the view engine system? Are you able to post an expanded code snippet to help me understand?
from postal.
I've created a branch that adds a basic Browser property to EmailHttpRequest: https://github.com/andrewdavey/postal/tree/browser-property
Can you try it out for me, with 51degrees, and report back if it works or not? Thanks.
from postal.
I created a sample project with Postal and 51degrees up on github, https://github.com/jpogran/51degreesPostal , it has the essence of what I'm trying to do.
I'll clone the branch and test it out today and let you know. Thanks much!
from postal.
Excellent - thanks. I think I see what's happening now. The _viewstart.cshtml file at the top level of ~/Views runs first when a view is rendered. So I guess this is were the exception is being thrown.
The branch I created for you has a very naive Browser property, it returns a new HttpBrowserCapabilities object, which I assume pick ups information from HttpContext.Current. I will probably need to implement my own subclass instead and return some sensible defaults there.
from postal.
Think you might have to do that. Added Postal from the branch, and we get further and get a Browser object, but no properties are filled.
from postal.
I've changed the following line in the EmailHttpRequest:
readonly Lazy browser = new Lazy(() => new HttpBrowserCapabilitiesWrapper(new HttpBrowserCapabilities() { Capabilities = HttpContext.Current.Request.Browser.Capabilities }));
it should work with both regular and Mobile views.
from postal.
@ppekrol's change has been added to master
. Thanks!
from postal.
Related Issues (20)
- Add support on other html attributes except alt in @Html.EmbedImage() HOT 2
- How to add external link with params? HOT 2
- Is this project still being supported? HOT 3
- How to identify if the email is sent or not HOT 4
- Html Helpers not working from console application HOT 4
- Postal MVC5 project references MVC 5.1.0.0 instead of 5.1.2 as the requirements state HOT 7
- Postal w/o MVC NuGet package?
- How to provide smtp settings runtime(not in web or app config)
- With Framework 4.6.2 it give error Attempted to access an element as a type incompatible with the array HOT 6
- Previewing emails with addresses with names HOT 4
- Install-Package : Input string was not in a correct format. HOT 6
- Continuation of Postal HOT 26
- enable sasl authentification HOT 7
- System.ArgumentNullException with .NET 4.5.2 WebApi HOT 9
- Sample For Postal.AspnetCore? HOT 3
- The parameter 'addresses' cannot be an empty string. HOT 1
- Layouts Stopped Working
- MVC4 throws exception when using autofac and MVC async controller actions HOT 3
- How to use Postal with Unity IoC Container MVC 5?
- Subject encoding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from postal.