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

  • SEARCH
  • Home
  • 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 9212299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:29:35+00:00 2026-06-18T01:29:35+00:00

My case is quite simple: I have a template for text/plain mails : body.txt

  • 0

My case is quite simple:

  • I have a template for text/plain mails : body.txt
  • Another one for text/html mails : body.html

The content of this two mail are the same because I use EmailAlternative to send both in the same mail.

body.txt:

{% block message %}{% endblock %}

{{ site_name }} team
-----------------
If you need help contact use at {{ support_mail }}

body.html:

<html>
    <head>
        <title>{% block title %}{% endblock %}</title>
    </head>
    <body>
        <p>{% filter linebreaksbr %}{% block message %}{% endblock %}{% endfilter %}</p>
        <p><strong>{{ site_name }} team</strong></p>
        <hr/>
        If you need help contact use at <a href="mailto:{{ support_mail }}">{{ support_mail }}</a>
    </body>
</html>

Of course it is a little bit more complex with translation, css and more than one block.

My wish is to define invitation.txt:

{% block message %}Dear {{ first_name|title }} {{ last_name|upper }},

Your inscription has bee accepted. Welcome!
{% endblock %}

I want to be able to load (body.txt, invitation.txt) and also (body.html, invitation.txt) to get my two html parts.

Edit:

Something like that:

invitation/body.txt:

{% extends body.txt invitation.txt %}

invitation/body.html:

{% extends body.html invitation.txt %}
  • 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-06-18T01:29:36+00:00Added an answer on June 18, 2026 at 1:29 am

    You can set a variable in the context and pass it to extends template tag.

    In invitation.txt:

    {% extends base %}
    {% block message %}Dear {{ first_name|title }} {{ last_name|upper }},
    
    Your inscription has been accepted. Welcome!
    {% endblock %}
    

    Render invitation.txt with context {'base': 'body.txt'}, then with context {'base': 'body.html'}.

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

Sidebar

Related Questions

I have another simple one. How to make a long decode inside a function
I have a quite specific client-server design case and I want to ask for
I am quite comfortable with generics and such, but in this special case I
Case One Say you have a little class: class Point3D { private: float x,y,z;
I have a quite simple task: I must check in wchich group my float
this is probably quite simple.. but I don't know what's the best practice here.
My problem is quite simple Suppose I have those class: public class A {
This may be a simple task but at the moment I really have no
I'm doing some relatively simple I/O in Java. I have a .txt files that
This could either be very simple or quite complex I'm not sure at this

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.