Question

Is it possible to set the "reply-to" header field in a Mailgun list? While conversations are sometimes nice, people are getting annoyed at the volume of mail from one particular list, in which respondents ignore the instruction to send the message to a certain email address and hit reply, resulting in dozens (or more) messages containing things like "Got it!" or "I'm coming!" when only one person needs to see the response.

For this particular list, the ideal situation would be to limit the allowed senders to just a few people, but as none of them use services quite as nice as Gmail or a standalone email client (additional SMTP logins cannot be established), I've not found any way to limit the inanity. Does anyone know how to do this?

Was it helpful?

Solution

I am not sure if you are still looking for the answer, but you can set the Reply-To header using the API.

h:Reply-To

I have been using it with an email hash - each user gets a unique hash in the reply-to field so I know who is replying. Basically the reply-to looks like this:

"h:Reply-To" : "inboundaddress+hash@mydomain.com"

In the routes panel add the following and you can redirect to your email or to an HTTP endpoint:

match_recipient("^inboundaddress\+(.*)@mydomain.com")

Hope that helps. Justin

OTHER TIPS

You can programmatically add the header "Reply-To" in the data you are sending.

For example, this snippet works well in Python:

import requests

url = 'https://api.mailgun.net/v3/YOUR_ACCOUNT/messages'
auth = ('api', 'YOUR_KEY')
data = {
    'from': 'Info <info@email.com>',
    'to': ['user1@email.com', 'user2@email.com'],
    'subject': 'test email',
    'html': '<b>hello!</b> that's all.,
    'text': 'plain text here',
    'o:tag': ['categoria 1', 'categoria 2']
}
data['h:Reply-To']="My name <my@email.com>"  # <------------- HERE!
res = requests.post(url, auth=auth, data=data)

Please check this issue in mailgun-js

https://github.com/bojand/mailgun-js/issues/57

You just need to add 'h:Reply-To' to your email configuration object:

  const options = {from, to, subject, text, html};

  if(replyToAddress){
    options['h:Reply-To'] = replyToAddress;
  }

That will add new header to the e-mail :)

I have been looking for the exact same functionality and have not yet found one. I even tried using the Routes but that did nothing more than forward an email before sending it out to everyone else. I opened a ticket with support and received the same reply. There is not a way to set that at this time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top