2

I am trying to send messages via SparkPost.com's SMTP API, and use their key:value substitution during message generation.

Not sure if my problem is simply syntax, or if my logic is wrong. I add this header during my SMTP conversation:

X-MSYS-API: {"options": {"open_tracking" : true, "click_tracking" :   true},"substitution_data": {"imgurl":"images.mydomain.com"}}

Then, in my message body, I insert {{imgurl}} where I need images.mydomain.com to appear.

My end results are that the {{imgurl}} "tokens" are replaced by nothing. So something is going on there. I don't see the original string ( the {{imgurl}}).

Any idea what I have done wrong here?

EddieB
  • 23
  • 4
  • I think you need to do that through the REST API https://www.sparkpost.com/api#/introduction/substitutions-reference and not through the SMTP API. – Yepher Nov 10 '15 at 00:58

1 Answers1

4

The SMTP API does not currently support the use of templating with substitution markers, or the use of templates.

You will need to use the REST API if you want to use substitution markers.

We at SparkPost are always interested in improving the user experience. If you have any suggestions, please let us know. For instance, would it help to add a note to https://www.sparkpost.com/api#/reference/smtp-api that substitution markers are not supported via the SMTP API?