Uzair Ahmad
Uzair Ahmad

Reputation: 31

Mandrill Reply-To Header when sending via Node.js

I am trying to figure out how to add a reply-to header to emails sent from my website using mandrill transactional API. I have tried multiple options but none is working. I want to implement a contact us form and send emails from my domain to support email where they can easily reply back to users.

{
    "key": "xxxxxxx",
    "template_name": "welcome-email",
    "template_content": {},
    "message": {
        "merge": true,
        "global_merge_vars": [
            {
                "name": "my_h_tag",
                "content": "THIS IS WORKING"
            }
        ],
        "merge_vars": [],
        "merge_language": "handlebars",
        "async": false,
        "subject": "Testing Revamp Api",
        "from_email": "hello@mydomain",
        "to": [
            {
                "email": "user email",
                "type": "to"
            }
        ],
        "headers": [
            {
                "reply_to": "user email eneterd in contact form"
            }
        ]
    }
}

Thanks in Advance.

Upvotes: 2

Views: 1618

Answers (1)

jnv
jnv

Reputation: 942

Your general approach is correct, passing Reply-To via headers should be supported, but the header is called reply-to (with the dash), while you use an underscore. Have you tried to use the dash?

Also, per documentation, headers should be an object.

{
  "key": "xxxxxxx",
  // ...
  "message": {
    // ...
    "headers": {
      "reply-to": "user email eneterd in contact form"
    }
  }
}

Related: Mandrill Reply-to

Upvotes: 1

Related Questions