Problems, need help? Have a tip or advice? Post it here.
8 posts Page 1 of 1
Hi,
New user of couch I'm trying to get an HTML email with the send_mail tag.
Here my code :
Code: Select all
<cms:form method='post' id='email-form' >
              <cms:if k_success >
               <h3>Merci de votre demande. Nous vous contacterons dans les plus bref délais</h3>
               <cms:send_mail from=k_email_from to=k_email_to subject='Contact depuis le site internet' debug="1" html="1">
               
               <cms:show k_success />
               <p>De la part de <cms:show nom/> pour une conçernant <cms:show type_de_devis/>.</p>
               <p><strong> informations de contact :</strong>
               <ul>
                  <li><cms:show telephone   /></li>
                  <li><cms:show email /></li>
               </ul>
               </p>
               <p><strong>Message</strong><br />
               <cms:nl2br><cms:show message/></cms:nl2br>
               </p>
            </cms:send_mail>
         </cms:if>


With this i get an html mail with in first line all the input and after that my html template without any value. Where is my mistake ? The documentation is bit thin about this.

Thanks for your help
Hi :)

Could you please post the exact output of your resulting email?
Since the debug setting is on, it'd be helpful if you could post the mail's entry in the log file too.

Please remove all email addresses for privacy.

Thanks.
There it is :
Code: Select all
=======================[2016-10-06 15:51:56]=======================

From: nicolas@semaphore-communication.fr

To: nicolas@semaphore-communication.fr

MIME-Version: 1.0

Content-Type: text/html; charset=utf-8

Subject: Contact depuis le site internet

Message:
               
               nom: XXXXXXX
telephone: 06XXXXXXXX
email: webmaster@semaphore-communication.fr
type_de_devis: sanitaires
message: test 6
               <p>De la part de  pour une conçernant .</p>
               <p><strong> informations de contact :</strong>
               <ul>
                  <li></li>
                  <li></li>
               </ul>
               </p>
               <p><strong>Message</strong><br />
               
               </p>
            



Delivery Success


In thunderbird :
couchcms-email.jpg
couchcms-email.jpg (50.51 KiB) Viewed 3530 times
Since this is in a submitted form( k_success block), all submitted values of your inputs( set inside the form) are available with a prefix frm_
So, whenever you want to output such value within k_success block as for example <cms:show nom /> - you want to actually put <cms:show frm_nom /> instead. So, in all <cms:show /> tags, these
nom
type_de_devis
telephone
email
message

would need to be replaced by
Code: Select all
frm_nom
frm_type_de_devis
frm_telephone
frm_email
frm_message
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Thanks for this information ! How to prevent the raw data of the inputs to show at the beginning of the email ?
Welcome! Remove show k_success in order to disable output of everything before the mail body.
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Oooh I have miss this little boy and confuse it with the if blocks. I think it could be great to add these information to the documentation ;-)
Thanks for all !
Welcome :)
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
8 posts Page 1 of 1