question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

messages().send(data) should allow setting of headers and options

See original GitHub issue

It would be awesome of I could give you arbitrary headers and options, that you would then transparently roll into the message posting.

e.g.

mailgun.messages().send({from: <sender>, 'h:Reply-To': <relay>, to: <recipient>})

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:12

github_iconTop GitHub Comments

3reactions
bojandcommented, Jan 21, 2015

Hello, that should already work. What version of the library are you using? For example this works for me:

var params = {
  to: 'youremail@company.com',
  from: 'test@mailgun.com',
  'h:Reply-To': 'noreply@mailgun.com',
  subject: 'testing reply to',
  text: 'testing message'
};

mailgun.messages().send(params, function (err, body) {
  if (err) console.dir(err);
  console.dir(body);
});

The received email will have header Reply-To: noreply@mailgun.com, and clicking reply to will set the to email to noreply@mailgun.com.

2reactions
blairjocommented, Aug 3, 2017

Hi @bojand It’s a fair point, and I can understand why you want to keep it as per the mailgun api, I just found it odd in the first place that mailgun didn’t allow you to specify replyTo as a regular param ( the way that say nodemailer does ). I thought it could be a useful ease of use feature for your library to add it as a first class citizen rather then having to remember the quite clunky h:Reply-To syntax.

Up to you though 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

messages().send(data) should allow setting of headers and ...
It would be awesome of I could give you arbitrary headers and options, that you would then transparently roll into the message posting....
Read more >
HTTP Messages - MDN Web Docs - Mozilla
The start-line and HTTP headers of the HTTP message are collectively known as the head of the requests, whereas its payload is known...
Read more >
About FCM messages | Firebase Cloud Messaging - Google
Use data messages when you want to process the messages on your client app. FCM can send a notification message including an optional...
Read more >
Messages — Mailgun API documentation
Mailgun will build a MIME representation of the message and send it. ... But you will have to specify all advanced sending options...
Read more >
HTTP/1.1: Header Field Definitions
The Accept request-header field can be used to specify certain media types which are acceptable for the response. Accept headers can be used...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found