Giter Site home page Giter Site logo

Comments (9)

andrewdavey avatar andrewdavey commented on September 25, 2024

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.

jpogran avatar jpogran commented on September 25, 2024

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.

andrewdavey avatar andrewdavey commented on September 25, 2024

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.

andrewdavey avatar andrewdavey commented on September 25, 2024

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.

jpogran avatar jpogran commented on September 25, 2024

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.

andrewdavey avatar andrewdavey commented on September 25, 2024

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.

jpogran avatar jpogran commented on September 25, 2024

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.

ppekrol avatar ppekrol commented on September 25, 2024

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.

andrewdavey avatar andrewdavey commented on September 25, 2024

@ppekrol's change has been added to master. Thanks!

from postal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.