• Resolved maltfield

    (@maltfield)


    How can I configure WooCommerce such that all emails are sent with both of the following sections:

    1. Content-Type: text/plain;
    2. Content-Type: text/html;

    Background: Not all email clients can view html (and, indeed, some users prefer to disable HTML in their email clients), so it’s normal practice for mass emails to be sent in the two above formats.

    When you send an email with *both* content types, it allows the user’s mail client to display the email in whichever format they choose.

    On my fresh install of WooCommerce, it only sends the emails in html format, which makes reading the email contents nearly impossible in my email client. I could change it to “plaintext”, but then it wouldn’t display in html for users who choose to view html emails.

    How can I configure WooCommerce to send emails in *both* plaintext *and* html?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Tamirat B. (a11n)

    (@tamirat22)

    Hello @maltfield!

    Thanks for reaching out!

    How can I configure WooCommerce to send emails in *both* plaintext *and* html?

    If you want to send your emails in both HTML and plain text format, you can configure that option from your email settings under WooCommerce → Settings → Emails.

    Once there, you can choose to configure email settings for a variety of cases like new orders, canceled orders, and more.

    For new orders, open the New order entry and change the Email type to Multipart, which includes both the plain text and HTML email versions. Don’t forget to save your changes once done.

    Hope this helps!

    Thread Starter maltfield

    (@maltfield)

    Hey @tamirat22 thanks ??

    May I request that the WooCommerce documentation be updated to include a section about this?

    * https://woocommerce.com/document/email-faq/

    It should have a few sentences that elaborate on what exactly it means to select each Email type:

    1. Plain text
    2. HTML
    3. Multipart

    Also, is there any way to quickly change all emails to a given email type? It’s like 100-clicks to just change the email type from one to another. SQL is fine.

    • This reply was modified 2 years, 9 months ago by maltfield.
    • This reply was modified 2 years, 9 months ago by maltfield.
    Plugin Support Tamirat B. (a11n)

    (@tamirat22)

    Hello @maltfield!

    Thanks for the follow-up message!

    Hey @tamirat22 thanks ??
    May I request that the WooCommerce documentation be updated to include a section about this?

    * https://woocommerce.com/document/email-faq/

    Glad you found the support needed and thanks for the feedback on the documentation.

    Also, is there any way to quickly change all emails to a given email type? It’s like 100-clicks to just change the email type from one to another. SQL is fine.

    This forum is dedicated to the core features and functionalities of WooCommerce. Customizations that go beyond that are outside the scope of this support forum.

    If you want to customize your emails beyond what is supported by the WooCommerce core, here is a great resource on how to go about that: https://woocommerce.com/posts/how-to-customize-emails-in-woocommerce/

    You can also consult Woo-vetted developers as described here: https://woocommerce.com/customizations/

    Hope this helps!

    Thread Starter maltfield

    (@maltfield)

    For anyone else interested, it appears that these settings are stored in the wp_options table, but the “email type” is not in its own field — it’s in a mixed JSON blob inside the option_value.

    You can get a list of woocommerce options that specify the email_type with this SQL query:

    
    select option_name from wp_options where option_name LIKE '%woocommerce%_settings' and option_value LIKE '%email_type%';
    

    On my site, that shows

    
    MariaDB [wp_db]> select option_name from wp_options where option_name LIKE '%woocommerce%_settings' and option_value LIKE '%email_type%';
    +---------------------------------------------------------+
    | option_name                                             |
    +---------------------------------------------------------+
    | woocommerce_new_order_settings                          |
    | woocommerce_cancelled_order_settings                    |
    | woocommerce_failed_order_settings                       |
    | woocommerce_customer_on_hold_order_settings             |
    | woocommerce_customer_processing_order_settings          |
    | woocommerce_customer_completed_order_settings           |
    | woocommerce_customer_refunded_order_settings            |
    | woocommerce_customer_invoice_settings                   |
    | woocommerce_customer_note_settings                      |
    | woocommerce_customer_reset_password_settings            |
    | woocommerce_customer_new_account_settings               |
    | woocommerce_failed_renewal_authentication_settings      |
    | woocommerce_failed_preorder_sca_authentication_settings |
    | woocommerce_failed_authentication_requested_settings    |
    +---------------------------------------------------------+
    

    Here’s one of them

    
    MariaDB [wp_db]> select option_name, option_value from wp_options where option_name = 'woocommerce_customer_completed_order_settings';
    +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | option_name                                   | option_value                                                                                                                                                             |
    +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    | woocommerce_customer_completed_order_settings | a:5:{s:7:"enabled";s:3:"yes";s:7:"subject";s:0:"";s:7:"heading";s:0:"";s:18:"additional_content";s:28:"Thanks for shopping with us.";s:10:"email_type";s:9:"multipart";} |
    +-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
    

    As you can see, the email_type for “completed order” will be sent in multipart

    Mirko P.

    (@rainfallnixfig)

    Hi @maltfield,

    That’s great! Thanks so much for sharing your findings. It’ll be helpful for others facing a similar issue.

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

    Cheers.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Send emails in both plaintext and html’ is closed to new replies.