from Hacker News

Phlex for Rails Emails: Action Mailer Without ERB

by camillovisini on 3/3/25, 8:20 AM with 24 comments

  • by axelthegerman on 3/3/25, 12:16 PM

    Nice write up, however personally I'd take ERB over Phlex a million times.

    Sure ERB is another DSL and some things are not perfect. But for the mark-up you write actual HTML instead of having to learn and get used to writing blocks for each element.

    I guess to each their own, you enjoy rails with Phlex and I will with ERB.

    I think the bigger challenges with emails is that action mailer itself is a little dated and feels cluttered. Most email clients being a nightmare with the actual rendering and not being able to use stylesheets etc makes it even harder... So I'd love to see a general iteration on action mailer to bring it up to the level of Rails 8

  • by xutopia on 3/3/25, 4:31 PM

    I can't help but feel that Rails is having a comeback now. Lots of people building really cool projects like this one popping up. The stack is insanely good for doing everything I need to do and the Hotwire Native stuff is starting to get more and more solid every day.
  • by dasil003 on 3/3/25, 2:28 PM

    Two decades in I still love ruby and rails, but I’m a bit surprised that the subculture promoting aesthetic perfection of code via over-wrought DSLs is still this strong. Haven’t we learned anything about pragmatism since 2009?
  • by dewey on 3/3/25, 1:41 PM

    There's a general pattern of:

        - People inventing new technologies to not write SQL   
        - People inventing ways to avoid writing HTML
    
    I feel like the solution to both of these is just to stick to SQL / HTML as for both of these there's a lot of resources, tooling and knowledge and they will not go away. They are transferable between languages, projects and whatever tooling companies are using.