HTML Email Weirdness

47 Views Asked by At

We're trying to send a response (via Sendgrid) to an email thread. We're formatting using the below HTML response template, but Gmail/Apple Mail are treating the "history" as part of the main email and thus failing to trim it (with ... / See More). Could anyone point out where this template is failing to mark the previous emails as history?

<div dir="ltr">
  <div dir="ltr">
    [HTML RESPONSE HERE]
  </div>

  <!-- Note: Everything below here is History -->
  <div class="gmail_extra">
    <div class="gmail_quote">
      <div dir="ltr" class="gmail_attr">
        <br>
        On ${ [DATE LIKE 'Jan 1, 2024 at 12:30 PM] }}, ${ [INSERT EMAIL SENDER] }
        <span dir="ltr">
          &lt;<a href="mailto:${ [EMAIL SENDER ADDRESS] }" target="_blank">
            ${ [EMAIL SENDER ADDRESS] }
          </a>&gt;
        </span>wrote:<br>
      </div>
      <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
        ${ [HTML EMAIL THAT WE GOT: htmlWeGot.replaceAll(
          'dir="ltr"',
          'dir="ltr" class="gmail_attr gmail_extra"'
        )] }
      </blockquote>
    </div>
  </div>
</div>

Thank you!

0

There are 0 best solutions below