# Refactor MessageBuilder to put mail footer 'action links' always in signature?

**URL:** https://meta.discourse.org/t/refactor-messagebuilder-to-put-mail-footer-action-links-always-in-signature/57212
**Category:** Development
**Created:** [2월 10, 2017, 3:21오후 UTC](https://meta.discourse.org/t/refactor-messagebuilder-to-put-mail-footer-action-links-always-in-signature/57212 "2017-02-10T15:21:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [2월 10, 2017, 3:21오후 UTC](https://meta.discourse.org/t/refactor-messagebuilder-to-put-mail-footer-action-links-always-in-signature/57212/1 "2017-02-10T15:21:38Z")

</div>

Hello,

I recently had a look into `message_builder.rb` to check out how the last few lines of most mails are generated:

```plaintext
[mail body]

---
[Visit Topic](https://meta.discourse.org/t/how-to-enable-piwik-analytics-on-discourse/33090/24) or reply to this email to respond.

To unsubscribe from these emails, [click here](https://meta.discourse.org/email/unsubscribe/3b1425417...e06a018707abea59569cca94999).

```

Here, we have two elements:

1. link to the topic with invitation to reply per mail
2. link to unsubscribe.

Both links do not contain any content and should not make it into the reply. _Proper_ (for some definition of proper) mail clients will strip of the signature when quoting the original message in the reply. That’s nice.

In the `message_builder.rb` we find:

```ruby
@template_args[:respond_instructions] = "-- \n" + I18n.t(string, @template_args)

```

and there is also:

```plaintext
@template_args[:unsubscribe_instructions] = I18n.t(unsubscribe_string, @template_args)

```

So I was asking myself, do we get the `-- \n` also in the case that we use only the link (1.), but not (2.) to ensure that we got a signature also if we do not use `respond_instructions`? I do not think so. Maybe that’s a configuration that never occurs. ❓

Find the current file here: [discourse/lib/email/message\_builder.rb at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/master/lib/email/message_builder.rb)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2월 11, 2017, 2:38오전 UTC](https://meta.discourse.org/t/refactor-messagebuilder-to-put-mail-footer-action-links-always-in-signature/57212/2 "2017-02-11T02:38:45Z")

</div>

This is Markdown. You are misreading the markup.

---

<div class="post-metadata">

### Author: ![rriemann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rriemann/32/115238_2.png) [@rriemann](https://meta.discourse.org/u/rriemann)
#### Post date: [2월 11, 2017, 7:06오전 UTC](https://meta.discourse.org/t/refactor-messagebuilder-to-put-mail-footer-action-links-always-in-signature/57212/3 "2017-02-11T07:06:58Z")

</div>

Then is probably my last merged commit a regression. ☹ @zogstrip

[https://github.com/discourse/discourse/pull/4699](https://github.com/discourse/discourse/pull/4699)

Any hint where I can find the code for the signature. I `grep`-ed lot and tried to find and write a spec (the latter without success).
