# 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:** [Fevereiro 10, 2017, 3:21pm 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:** 1\
**Showing post:** 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:** [Fevereiro 10, 2017, 3:21pm 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)

---

_[View the full topic](https://meta.discourse.org/t/refactor-messagebuilder-to-put-mail-footer-action-links-always-in-signature/57212)._
