Closed
Description
Description (*)
There is a subscribe field on a standard Magento storefront:
Currently, GraphQl does not have a mutation which allow to subscribe guest/customer into a newsletter subscription.
Expected behavior (*)
Benefits
Additional information
A proposed schema:
type Mutation {
subscribeEmailToNewsletter(input: SubscribeInput): SubscribeOutput @resolver(class: "\\Vendor\\ModuleGraphQl\\Model\\Resolver\\SubscribeEmailToNewsletter") @doc(description:"Adds an email into a newsletter subscription")
}
input SubscribeInput {
email: String! @doc(description: "Email")
}
type SubscribeOutput {
success: Boolean! @doc(description: "Returns 'true' if an email has been added to newsletter successfully")
message: String! @doc(description: "Returns a success or an error messages")
}
Example of usage:
mutation {
subscribeEmailToNewsletter(
input: {
email: "[email protected]"
}
) {
success
message
}
}
Response:
{
"data": {
"subscribeEmailToNewsletter": {
"success": true,
"message": "Thank you for your subscription."
}
}
}
Metadata
Metadata
Assignees
Labels
GraphQLThe issue has been fixed in 2.4-develop branchGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentPull Request is created by partner AtwixA defect with this priority could have functionality issues which are not to expectations.The issue has been reproduced on latest 2.4-develop branchAffects non-critical data or functionality and does not force users to employ a workaround.Has been reviewed and prioritized during Triage with Product Managers