0

All emails sent by the Magento system have only a RAWBody according to IMAP. Is it possible to change the email body to HTMLBody or TextBody?

Can anyone tell if this problem affects Magento or the email server settings?

Anyway, I need to parse the emails for a CRM system, is there an easy way?

// Looks like an Zend_mail problem issue. Also i have problems with the encoding. Its stated utf-8 but i isnt utf-8. This is what the IMAP return looks like

RawBody:

Return-Path: Received: from localhost ([2a01:4f8:171:18e2::2]) by smtp.gmail.com with ESMTPSA id v16sm24477054wrt.12.2019.10.02.09.07.05 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Oct 2019 09:07:05 -0700 (PDT) Message-ID: Reply-To: email@email.com To: =?utf-8?B?aW5mbw==?= Subject: =?utf-8?B?SWhyZSBBbmZyYWdlIGF1ZiBSZWxhZ2lvLmRlIC0gQW50b25pbyBTYW5jaGV6ICYgQmVyZW5nYXIgU2NobWlkdA==?= From: email Date: Wed, 02 Oct 2019 16:07:05 +0000 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline MIME-Version: 1.0 =0A=0A=0AName: username=0AEmail: email=0ATelefon: 01234345=0ANachricht: rehgcghgf

0

go to admin

system -> Transactional Emails -> add new template 

from Load default template section load **contact Form**

change as per your need and save template

now go to

system -> configuration -> general -> contact -> change Email Template

0

You need to create a new custom module to override core contact email template type in Magento 2.

app/code/[Vendor]/[Module]/etc/module.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_Module" setup_version="1.0.0">
        <sequence>
            <module name="Magento_Contact"/>
        </sequence>
    </module>
</config>

app/code/[Vendor]/[Module]/etc/email_templates.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Email:etc/email_templates.xsd">
    <template id="contact_email_email_template" label="Contact Form" file="submitted_form.html" type="html" module="Magento_Contact" area="adminhtml"/>
</config>

In above code, I've added type="html" to set contact email template type to HTML.

After your changes, run the deployment commands.

Edit: For Magento 1

Create a custom module and put below code in app/code/local/Vendor/Module/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Vendor_Module>
            <version>1.0.0</version>
        </Vendor_Module>
    </modules>
    <global>
        <template>
            <email>
                <contacts_email_email_template translate="label" module="contacts">
                    <type>html</type><!-- same xpath as in the original config file -->
                </contacts_email_email_template>
            </email>
        </template>
    </global>
</config>

Hope it helps!!!

  • im not using magento 2...dunno why someone edited it to magento 2. magento 2 is for idiots. – IamTheDrifter Oct 1 at 9:34
  • You've not specified the version of your Magento. Please wait a while, I'm updating my code for M1 – Sumit Oct 1 at 9:36
  • Updated my answer for the M1 version as well. Please check. – Sumit Oct 1 at 9:39
  • i am very grateful for your help. the problem cannot be solved because the problem affects all emails. i have changed the description and redescribed the problem. but your solution is correct to display HTML content in RAWBody, which is interpreted correctly by email programs. – IamTheDrifter Oct 2 at 14:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.