Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

GraphQL-202: [Mutations] adds sendEmailFriend Logic #226

Merged

Conversation

maile-it-solutions
Copy link
Contributor

@maile-it-solutions maile-it-solutions commented Oct 26, 2018

Description (*)

Adds a Module to handle the sendFriend module logic with GraphQL. It is possible to send multiple product recommendation emails. As an Example of a query have a look at the following:

mutation {
    sendEmailToFriend(
        input: {
          product_id: 3	
          sender: {
            name: "Name"
            email: "[email protected]"
           message: "Lorem Ipsum"
        }          
          recipients: [
              {
                  name: "Recipient Name 1"
                  email:"[email protected]"
               },
              {
                  name: "Recipient Name 2"
                  email:"[email protected]"
              }
          ]
        } 
    ) {
        sender {
            name
            email
            message
        }
        recipients {
            name
             email
        }
    }
}

All Inputs are being validatet and Errors are being displayed accordingly.
The fitting output of the example query is the following:

{
  "data": {
    "sendEmailToFriend": {
      "sender": {
        "name": "Name",
        "email": "[email protected]",
        "message": "Lorem Ipsum"
      },
      "recipients": [
        {
          "name": "Recipient Name 1",
          "email": "[email protected]"
        },
        {
          "name": "Recipient Name 2",
          "email": "[email protected]"
        }
      ]
    }
  }
}

Note:

  • Test Implementations are still missing
  • Missing @todo: Clearify if the event needs to be dispatched see
    app/code/Magento/SendFriendGraphQl/Model/Resolver/SendEmailToFriend.php:58

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented Oct 26, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

@tobiascm thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants