Skip to content

Instantly share code, notes, and snippets.

@DeskWOW
Last active October 25, 2016 11:10
Show Gist options
  • Save DeskWOW/6678095 to your computer and use it in GitHub Desktop.
Save DeskWOW/6678095 to your computer and use it in GitHub Desktop.
You can copy and paste the following code into the Email Reply Theme to make your emails look like they are sent from gmail.
{% assign emails = case.emails %}
{% assign threadlength = emails.size|minus:1 %}
{% for email in emails reversed %}
{% if forloop.first %}
{{email.new_html}}
{% if email.agent %}
{% if email.agent.signature %}
<div style="margin-top:10px;"> {{email.agent.signature | newline_to_br}}</div>
{% else %}
<p>
--<br />
{{email.agent.name_public}}<br />
</p>
{% endif %}
{% endif %}
{% else %}
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On {{email.created_at | in_time_zone: site.timezone | date: "%b %d, %Y”}} at {{email.created_at | in_time_zone: site.timezone | date: "%I:%M%p %Z"}} {{email.from}} &lt;{{email.from_address}}&gt; wrote:<br/><br />
{{email.new_html}}
{% if email.agent %}
{% if email.agent.signature %}
<div style="margin-top:10px;"> {{email.agent.signature | newline_to_br}}</div>
{% else %}
<p>
--<br />
{{email.agent.name_public}}<br />
</p>
{% endif %}
{% endif %}
{% endif %}
<br />
{% endfor %}
{% for i in (1..threadlength) %} {{ '</blockquote>' }} {% endfor %}
{% assign emails = case.emails %}{% for email in emails reversed %}
{% unless forloop.first %}
On {{email.send_at | in_time_zone: site.timezone | date: "%b %d, %Y"}} at {{email.send_at | in_time_zone: site.timezone | date: "%I:%M%p %Z"}}, {% if email.agent %}{{email.agent.name_public}} {% else %}{% if customer.id == email.from_customer.id %}{{customer.first_name}} <{{ customer.email }}>{% else %}{{email.from_customer.first_name}} <{{ email.from_customer.email }}>{% endif %}{% endif %} wrote:
{% endunless %}
{{email.new_text}}
{% if email.agent %}
--
{% if email.agent.signature %}{{email.agent.signature | strip_html }}{%else%}{{email.agent.name_public}}{% endif %}
{% endif %}{% endfor %}
@zaridan
Copy link

zaridan commented Oct 14, 2014

This is a nice simple template, thanks for sharing.

I would LOVE to see the default System Notification Theme be made into an Email Reply Theme, if any of you nice WoW people could be so kind :)

@CaseyA
Copy link

CaseyA commented Nov 7, 2014

Agreed. Would be awesome if this was a baked in option. I tested with replies to Yahoo and the formatting does not match and the links do not work properly.

@holic
Copy link

holic commented Feb 23, 2015

It looks like Desk still enforces their own template around these custom themes, adding a visible line above the response body of the email.

See this email source snippet using the plaintext theme from above:

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: Quoted-printable
X-Mailer: Desk.com Support Platform

__________________________________
Hi there!

Comment ca va?

--

Cheers,

@costajoao
Copy link

Great job! Works well 👍

@ThemesForDesk
Copy link

or just get a theme for your Desk email reply that's easy to brand

@paulmichaelbrowne
Copy link

Is there a forward theme that looks like the Gmail format?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment