Class KitClientMain
java.lang.Object
com.endurancetrio.app.newsletter.client.KitClientMain
- All Implemented Interfaces:
KitClient
RestClient-backed implementation of KitClient.
Performs the two Kit.com v4 API calls needed for newsletter subscription. Lives in
endurancetrio-app so the business module remains free of web/HTTP dependencies.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSubscriberToForm(Long subscriberId, String formId) Adds an already-created subscriber to a Kit.com form, triggering the double opt-in e-mail configured on that form.Creates or updates a subscriber in Kit.com and returns their subscriber ID.
-
Constructor Details
-
KitClientMain
-
-
Method Details
-
addSubscriberToForm
Description copied from interface:KitClientAdds an already-created subscriber to a Kit.com form, triggering the double opt-in e-mail configured on that form.- Specified by:
addSubscriberToFormin interfaceKitClient- Parameters:
subscriberId- the Kit.com subscriber IDformId- the Kit.com form ID- Throws:
EnduranceTrioException- if the API call fails
-
createOrUpdateSubscriber
Description copied from interface:KitClientCreates or updates a subscriber in Kit.com and returns their subscriber ID.- Specified by:
createOrUpdateSubscriberin interfaceKitClient- Parameters:
dto- the subscriber's first name and e-mail address- Returns:
- the Kit.com subscriber ID
- Throws:
EnduranceTrioException- if the API call fails
-