Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1024439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:46:43+00:00 2026-05-16T11:46:43+00:00

I want to render an HTML-EMail and send it to our customers using some

  • 0

I want to render an HTML-EMail and send it to our customers using some ERB Templates.

The basic code I am using:

ERB.new("newsletter.html.erb").result(binding)

doesn’t allow me to add partials to the html.erb-File. I would love to move the header and footer to a partial and use the render :partial-Method in that call.

Is this possible? What do I have to add?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:46:44+00:00Added an answer on May 16, 2026 at 11:46 am

    This is what I came up with:

    viewer = ActionView::Base.new(File.join(Rails::Configuration.new.view_path, "PATH/TO/PARTIALS"))
    html = viewer.render(
        :file => "PATH/TO/FILE.ERB), 
        :locals => {:variable => @var}
    )
    

    please correct me if there is a more elegant solution than this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send an email with a template like this. {% extends base.html
I'm using a QTabWidget to render multiple documents in a window, and I want
What I want to do is render a SSRS 2008 report as HTML (actually
I want to render a partial depending on a selection in selection box. This
I am using google reader for my RSS, i want to export all my
I want to create a Java application bundle for Mac without using Mac. According
We are generating a newsletter automatically every 24 hours using a rake task. There's
After user places an order I have to send detailed email message containing order
For a new SaaS app that I'm working on, I want the end user
I have a very basic email app. The forms class is: class ContactForm(forms.Form): name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.