Skip to main content
Version: 2.0.0

SubscribeCustomer

Description

Subscribes an e-mail address to newsletter subscriptions. Operation name: subscribeCustomer.

The mutation supports:

  • first-time subscription
  • already-subscribed response
  • reactivation of previously unsubscribed record

Endpoint

mutation subscribeCustomer($email: String!) {
subscribeCustomer(email: $email) {
success
message
subscribedEmail
alreadyExists
wasReactivated
}
}

Arguments

ArgumentTypeRequiredDescription
emailStringYesSubscriber e-mail address.

Return Values

Returns CustomerSubscription:

FieldTypeDescription
successBooleanWhether operation completed successfully.
messageStringHuman-readable result message.
subscribedEmailStringE-mail that was processed.
alreadyExistsBooleanWhether subscriber already existed.
wasReactivatedBooleanWhether existing unsubscribed record was reactivated.

Usage Example

mutation {
subscribeCustomer(email: "customer@example.com") {
success
message
alreadyExists
wasReactivated
}
}

Notes

  • Plugin setting customerSubscriptionEnabled must be enabled.
  • Empty/invalid email input throws a customer error.