Django templates. I get in my mail parameters, how can I send them to another html with include?












0














This is my welcome container:



<tr>
<td align="center">
<!-- Start internal container -->
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td height="30" style="line-height:30px; font-size:30px;">&nbsp;</td>
</tr>
<tr>
<td align="left" style="font-family: 'Lato', sans-serif; font-size:20px; line-height:26px;">
<p style="font-family: 'Lato', sans-serif; margin: 0; padding: 15px 60px 15px 60px; font-weight: bold; color: #333333;">
{{ title }}
</p>
<p style="font-family: 'Lato', sans-serif; font-size:16px; margin: 0; padding: 0px 60px 0px 60px; color: #333333;">
{{ subtitle }}
</p>
</td>
</tr>
</table>
<!-- End internal container -->
</td>




I tried this:



  {% "Hi {{first_name}}" as  titleStr%}
{% with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
{% include "emails/_parts/welcome_container.html" %}
{% endwith %}


But I get this issue:



Invalid block tag on line 29: '"Hi', expected 'endblock'. Did you forget to register or load this tag?


What am I doing wrong? Line 29 is the one with title=titleStr










share|improve this question



























    0














    This is my welcome container:



    <tr>
    <td align="center">
    <!-- Start internal container -->
    <table width="100%" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td height="30" style="line-height:30px; font-size:30px;">&nbsp;</td>
    </tr>
    <tr>
    <td align="left" style="font-family: 'Lato', sans-serif; font-size:20px; line-height:26px;">
    <p style="font-family: 'Lato', sans-serif; margin: 0; padding: 15px 60px 15px 60px; font-weight: bold; color: #333333;">
    {{ title }}
    </p>
    <p style="font-family: 'Lato', sans-serif; font-size:16px; margin: 0; padding: 0px 60px 0px 60px; color: #333333;">
    {{ subtitle }}
    </p>
    </td>
    </tr>
    </table>
    <!-- End internal container -->
    </td>




    I tried this:



      {% "Hi {{first_name}}" as  titleStr%}
    {% with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
    {% include "emails/_parts/welcome_container.html" %}
    {% endwith %}


    But I get this issue:



    Invalid block tag on line 29: '"Hi', expected 'endblock'. Did you forget to register or load this tag?


    What am I doing wrong? Line 29 is the one with title=titleStr










    share|improve this question

























      0












      0








      0







      This is my welcome container:



      <tr>
      <td align="center">
      <!-- Start internal container -->
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
      <tr>
      <td height="30" style="line-height:30px; font-size:30px;">&nbsp;</td>
      </tr>
      <tr>
      <td align="left" style="font-family: 'Lato', sans-serif; font-size:20px; line-height:26px;">
      <p style="font-family: 'Lato', sans-serif; margin: 0; padding: 15px 60px 15px 60px; font-weight: bold; color: #333333;">
      {{ title }}
      </p>
      <p style="font-family: 'Lato', sans-serif; font-size:16px; margin: 0; padding: 0px 60px 0px 60px; color: #333333;">
      {{ subtitle }}
      </p>
      </td>
      </tr>
      </table>
      <!-- End internal container -->
      </td>




      I tried this:



        {% "Hi {{first_name}}" as  titleStr%}
      {% with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
      {% include "emails/_parts/welcome_container.html" %}
      {% endwith %}


      But I get this issue:



      Invalid block tag on line 29: '"Hi', expected 'endblock'. Did you forget to register or load this tag?


      What am I doing wrong? Line 29 is the one with title=titleStr










      share|improve this question













      This is my welcome container:



      <tr>
      <td align="center">
      <!-- Start internal container -->
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
      <tr>
      <td height="30" style="line-height:30px; font-size:30px;">&nbsp;</td>
      </tr>
      <tr>
      <td align="left" style="font-family: 'Lato', sans-serif; font-size:20px; line-height:26px;">
      <p style="font-family: 'Lato', sans-serif; margin: 0; padding: 15px 60px 15px 60px; font-weight: bold; color: #333333;">
      {{ title }}
      </p>
      <p style="font-family: 'Lato', sans-serif; font-size:16px; margin: 0; padding: 0px 60px 0px 60px; color: #333333;">
      {{ subtitle }}
      </p>
      </td>
      </tr>
      </table>
      <!-- End internal container -->
      </td>




      I tried this:



        {% "Hi {{first_name}}" as  titleStr%}
      {% with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
      {% include "emails/_parts/welcome_container.html" %}
      {% endwith %}


      But I get this issue:



      Invalid block tag on line 29: '"Hi', expected 'endblock'. Did you forget to register or load this tag?


      What am I doing wrong? Line 29 is the one with title=titleStr







      html django django-templates include email-templates






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 28 '18 at 9:44









      rosu alinrosu alin

      2,51883899




      2,51883899
























          2 Answers
          2






          active

          oldest

          votes


















          0














          You have added {% "Hi" %} in template where django considers 'Hi' as template tag but it does not exists in django and that's why its throwing an error. You probably want add Hello in front of title variable and pass it to the another template. You can do this via add template tag.



          {% with "Hello "|add:first_name as titleStr %}
          {% include 'emails/_parts/welcome_container.html' with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
          {% endwith %}





          share|improve this answer























          • This works, thanks a lot!!!
            – rosu alin
            Dec 28 '18 at 12:46



















          0














          you write {% "Hi, and django template know this is start of block tag. If you want show text only, change it to "Hi {{first_name}}"



          if you want pass variable with include, try this:



          {% include "emails/_parts/welcome_container.html" with title={{first_name}} %}



          document for include https://docs.djangoproject.com/en/2.1/ref/templates/builtins/#include






          share|improve this answer





















          • This code gives me this: TemplateSyntaxError at /mail/account/confirm Could not parse the remainder: '{{first_name}}' from '{{first_name}}'
            – rosu alin
            Dec 28 '18 at 10:20










          • i cant see anything in this html question contain /mail/account/confirm. Its maybe happen from another code. Try find your code and remove it temporary for test
            – Ngoc Pham
            Dec 28 '18 at 10:26










          • It's from that line. I did it with the logic Aniket Pawar provided me and that worked
            – rosu alin
            Dec 28 '18 at 12:30











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53956470%2fdjango-templates-i-get-in-my-mail-parameters-how-can-i-send-them-to-another-ht%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          You have added {% "Hi" %} in template where django considers 'Hi' as template tag but it does not exists in django and that's why its throwing an error. You probably want add Hello in front of title variable and pass it to the another template. You can do this via add template tag.



          {% with "Hello "|add:first_name as titleStr %}
          {% include 'emails/_parts/welcome_container.html' with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
          {% endwith %}





          share|improve this answer























          • This works, thanks a lot!!!
            – rosu alin
            Dec 28 '18 at 12:46
















          0














          You have added {% "Hi" %} in template where django considers 'Hi' as template tag but it does not exists in django and that's why its throwing an error. You probably want add Hello in front of title variable and pass it to the another template. You can do this via add template tag.



          {% with "Hello "|add:first_name as titleStr %}
          {% include 'emails/_parts/welcome_container.html' with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
          {% endwith %}





          share|improve this answer























          • This works, thanks a lot!!!
            – rosu alin
            Dec 28 '18 at 12:46














          0












          0








          0






          You have added {% "Hi" %} in template where django considers 'Hi' as template tag but it does not exists in django and that's why its throwing an error. You probably want add Hello in front of title variable and pass it to the another template. You can do this via add template tag.



          {% with "Hello "|add:first_name as titleStr %}
          {% include 'emails/_parts/welcome_container.html' with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
          {% endwith %}





          share|improve this answer














          You have added {% "Hi" %} in template where django considers 'Hi' as template tag but it does not exists in django and that's why its throwing an error. You probably want add Hello in front of title variable and pass it to the another template. You can do this via add template tag.



          {% with "Hello "|add:first_name as titleStr %}
          {% include 'emails/_parts/welcome_container.html' with title=titleStr subtitle="Please confirm your email address by clicking this button." %}
          {% endwith %}






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 28 '18 at 10:23

























          answered Dec 28 '18 at 10:07









          Aniket PawarAniket Pawar

          1,501721




          1,501721












          • This works, thanks a lot!!!
            – rosu alin
            Dec 28 '18 at 12:46


















          • This works, thanks a lot!!!
            – rosu alin
            Dec 28 '18 at 12:46
















          This works, thanks a lot!!!
          – rosu alin
          Dec 28 '18 at 12:46




          This works, thanks a lot!!!
          – rosu alin
          Dec 28 '18 at 12:46













          0














          you write {% "Hi, and django template know this is start of block tag. If you want show text only, change it to "Hi {{first_name}}"



          if you want pass variable with include, try this:



          {% include "emails/_parts/welcome_container.html" with title={{first_name}} %}



          document for include https://docs.djangoproject.com/en/2.1/ref/templates/builtins/#include






          share|improve this answer





















          • This code gives me this: TemplateSyntaxError at /mail/account/confirm Could not parse the remainder: '{{first_name}}' from '{{first_name}}'
            – rosu alin
            Dec 28 '18 at 10:20










          • i cant see anything in this html question contain /mail/account/confirm. Its maybe happen from another code. Try find your code and remove it temporary for test
            – Ngoc Pham
            Dec 28 '18 at 10:26










          • It's from that line. I did it with the logic Aniket Pawar provided me and that worked
            – rosu alin
            Dec 28 '18 at 12:30
















          0














          you write {% "Hi, and django template know this is start of block tag. If you want show text only, change it to "Hi {{first_name}}"



          if you want pass variable with include, try this:



          {% include "emails/_parts/welcome_container.html" with title={{first_name}} %}



          document for include https://docs.djangoproject.com/en/2.1/ref/templates/builtins/#include






          share|improve this answer





















          • This code gives me this: TemplateSyntaxError at /mail/account/confirm Could not parse the remainder: '{{first_name}}' from '{{first_name}}'
            – rosu alin
            Dec 28 '18 at 10:20










          • i cant see anything in this html question contain /mail/account/confirm. Its maybe happen from another code. Try find your code and remove it temporary for test
            – Ngoc Pham
            Dec 28 '18 at 10:26










          • It's from that line. I did it with the logic Aniket Pawar provided me and that worked
            – rosu alin
            Dec 28 '18 at 12:30














          0












          0








          0






          you write {% "Hi, and django template know this is start of block tag. If you want show text only, change it to "Hi {{first_name}}"



          if you want pass variable with include, try this:



          {% include "emails/_parts/welcome_container.html" with title={{first_name}} %}



          document for include https://docs.djangoproject.com/en/2.1/ref/templates/builtins/#include






          share|improve this answer












          you write {% "Hi, and django template know this is start of block tag. If you want show text only, change it to "Hi {{first_name}}"



          if you want pass variable with include, try this:



          {% include "emails/_parts/welcome_container.html" with title={{first_name}} %}



          document for include https://docs.djangoproject.com/en/2.1/ref/templates/builtins/#include







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 28 '18 at 9:58









          Ngoc PhamNgoc Pham

          29417




          29417












          • This code gives me this: TemplateSyntaxError at /mail/account/confirm Could not parse the remainder: '{{first_name}}' from '{{first_name}}'
            – rosu alin
            Dec 28 '18 at 10:20










          • i cant see anything in this html question contain /mail/account/confirm. Its maybe happen from another code. Try find your code and remove it temporary for test
            – Ngoc Pham
            Dec 28 '18 at 10:26










          • It's from that line. I did it with the logic Aniket Pawar provided me and that worked
            – rosu alin
            Dec 28 '18 at 12:30


















          • This code gives me this: TemplateSyntaxError at /mail/account/confirm Could not parse the remainder: '{{first_name}}' from '{{first_name}}'
            – rosu alin
            Dec 28 '18 at 10:20










          • i cant see anything in this html question contain /mail/account/confirm. Its maybe happen from another code. Try find your code and remove it temporary for test
            – Ngoc Pham
            Dec 28 '18 at 10:26










          • It's from that line. I did it with the logic Aniket Pawar provided me and that worked
            – rosu alin
            Dec 28 '18 at 12:30
















          This code gives me this: TemplateSyntaxError at /mail/account/confirm Could not parse the remainder: '{{first_name}}' from '{{first_name}}'
          – rosu alin
          Dec 28 '18 at 10:20




          This code gives me this: TemplateSyntaxError at /mail/account/confirm Could not parse the remainder: '{{first_name}}' from '{{first_name}}'
          – rosu alin
          Dec 28 '18 at 10:20












          i cant see anything in this html question contain /mail/account/confirm. Its maybe happen from another code. Try find your code and remove it temporary for test
          – Ngoc Pham
          Dec 28 '18 at 10:26




          i cant see anything in this html question contain /mail/account/confirm. Its maybe happen from another code. Try find your code and remove it temporary for test
          – Ngoc Pham
          Dec 28 '18 at 10:26












          It's from that line. I did it with the logic Aniket Pawar provided me and that worked
          – rosu alin
          Dec 28 '18 at 12:30




          It's from that line. I did it with the logic Aniket Pawar provided me and that worked
          – rosu alin
          Dec 28 '18 at 12:30


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53956470%2fdjango-templates-i-get-in-my-mail-parameters-how-can-i-send-them-to-another-ht%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas