A
A
Alexey2021-01-26 18:58:53
Email
Alexey, 2021-01-26 18:58:53

Is it possible to increase the width of the email content in text/plain format?

Good day!

Tell me, please, is it possible to somehow adjust the width of the content of the letter, if it is transmitted in the text/plain format? And if possible, how and where?

The bottom line: a letter in this format comes very compressed in width, prices are cut off and it all looks extremely unattractive.
60103c9223cd9793816063.jpeg
Wordpress website with Woocommerce store.

Thank you in advance.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey, 2021-01-27
@For_Que

Found a solution - increased the maximum length of the line, now the break does not occur.
If suddenly it will be useful to someone, then:
In the file /wp-content/plugins/woocommerce/includes/emails/class-wc-email.php on line 539, change the value "70":

if ( 'plain' === $this->get_email_type() ) {
      $email_content = wordwrap( preg_replace( $this->plain_search, $this->plain_replace, wp_strip_all_tags( $this->get_content_plain() ) ), 70 );
    } else {
      $email_content = $this->get_content_html();
    }

    return $email_content;
  }

V
Vladimir Dubrovin, 2021-01-27
@z3apa3a

Formally, to solve this problem, you need to specify format=fixed in Content-type,
Content-type: text/plain; format=fixed
see https://tools.ietf.org/html/rfc2646
then a linefeed is treated as the end of a line, with format=flowed a linefeed is treated as the end of a paragraph and the lines are automatically split to fit the width of the screen.
Somewhere this may work, but in practice, in modern realities, this does not work, because. no one uses fixed fonts and a fixed screen width for a long time, and an ugly line is a lesser evil than horizontal scrolling. Use HTML and draw a sign.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question