Giter Club home page Giter Club logo

Comments (12)

yepher avatar yepher commented on August 17, 2024 1

I've added an initial implementation for sub account support to the "feature/subaccount" branch.

Usage is like this:

IRestConnection connection = new RestConnection(this.client, getEndPoint());
connection.setSubAccountId("1234");

Anything that connection is used for will set the X-MSYS-SUBACCOUNT header and the request.

from java-sparkpost.

java-extreme avatar java-extreme commented on August 17, 2024 1

I have this problem also. I would like to send the email out with the SubAccount but have no way to add the header X-MSYS-SUBACCOUNT using the Sparkpost Java Integration. Is there an estimate on when this enhancement will be available?

I believe if there was a method on the connection class to set a header that would be a great fix. I would suggest something like the following:

IRestConnection connection = new RestConnection(this.client, getEndPoint());
connection.addHeader("X-MSYS-SUBACCOUNT","XXXXXXXXXXXX");

from java-sparkpost.

yepher avatar yepher commented on August 17, 2024

Sub accounts should work with this library. Can you give me an example so I can make an example for you?

from java-sparkpost.

cen1 avatar cen1 commented on August 17, 2024

Let's say how to create a new subaccount.

from java-sparkpost.

yepher avatar yepher commented on August 17, 2024

Oh, I see what you mean now. Yes, that does need added. I would be happy to merge a pull request if you are interested in working on it.

Otherwise I will work on it in a week or so.

from java-sparkpost.

cen1 avatar cen1 commented on August 17, 2024

I might do a pull request but I make no promises. If there is none in a week go ahead with the implementation. Thanks.

from java-sparkpost.

cen1 avatar cen1 commented on August 17, 2024

Further, is it possible to add X-MSYS-SUBACCOUNT header in any way? Looking at the RestConnection implementation there seems to be no way to manipulate HttpURLConnection so my guess is a no.

If you can give me that example for calling the API as a subaccount I'd appreciate it.

from java-sparkpost.

yepher avatar yepher commented on August 17, 2024

I thought that was on a branch but I don't see it. I will add that ability.

from java-sparkpost.

scarlier avatar scarlier commented on August 17, 2024

any progress on this issue?

from java-sparkpost.

yepher avatar yepher commented on August 17, 2024

I am going to start implementing this now. My goal is to not break backward compatibility (somehow).

from java-sparkpost.

scarlier avatar scarlier commented on August 17, 2024

would be nice to see this update on maven

from java-sparkpost.

yepher avatar yepher commented on August 17, 2024

This is released in version 0.22

from java-sparkpost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.