Skip to content
This repository has been archived by the owner on Jun 6, 2019. It is now read-only.

Latest commit

 

History

History

email

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Arquiyalt Email

Table Of Contents

Development

Clone the repo and cd to email directory

yarn
yarn dev

Environment variables

variable default use
API_URI localhost:3000 api url
PORT 3001 port in which email client will listen for requests
MAIL_NAME Grupo1-Dev name that appears when email is received
MAIL_USER [email protected] mail account username
MAIL_PASSWORD arqui123 mail account password
API_MAILER_SECRET apimailersecret secret token to authenticate with api

Emails specification

Email address

The email address clients must contact is [email protected]


Helper format

  • Subject: "Ayuda" (or any invalid header)
  • Body: ""

This will send and email with all the possible Email formats you can send.


Buy format

  • Subject: "Compra"
  • Body: "productId1;productId2;productId3;productId4"

This will result in buying the products with id productId1, productId2, productId3 and productId4


Query formats

One or more products

  • Subject: "Productos"
  • Body: "productId1;productId2;productId3;productId4"

Retrieve the information of the products with id productId1, productId2, productId3 and productId4.


All products

  • Subject: "Catalogo"
  • Body: ""

Retrieve the information of all products.


All products from one or more categories

  • Subject: "Productos por categoria"
  • Body: "idCategoria1;idCategoria2"

Retrieve the information of the categories with id is idCategoria1 and idCategoria2, with the information of the products that belong to that category.


All products from all categories

  • Subject: "Catalogo por categoria"
  • Body: ""

Retrieve the information of all categories, with the information of the products that belong to the categories.


One category

  • Subject: "Categoria"
  • Body: "idCategoria"

Retrieve the information of the category with id is idCategoria.


All categories

  • Subject: "Categorias"
  • Body: ""

Retrieve the information of all existing categories in the store.


Api usage

Order status

This endpoint receive the status of a pre-made purchase to inform the client of the status of that request.

  • Route: POST /orderStatus/

  • Headers:

    • Content-Type: application/json
    • Secret:
      • Example through email
        • Secret: apimailersecret
  • Example Body:

    {
      "user": "[email protected]",
      "products":
      [
        { id: 104, name: 'Factor 50', price: 2300, passed: true },
        { id: 1045, name: 'AXE', price: 1700, passed: true }
      ]
      "errors":
      {
        notMedicine:
        [
          { id: 10, name: 'Paracetamol', price: 700, passed: false }
        ],
        notBeenBoughtToday:
        [
          { id: 1042, name: 'OldSpice', price: 1700, passed: false },
          { id: 105, name: 'Factor 30', price: 1700, passed: false }
        ]
      }
      "confirmationUrl": "<filtered order confirmation url>"
    }

    or

    {
    "user": '[email protected]',
    "resolved":
      {
        "productId": 1042,
        "productName": 'OldSpice'
      }
    }
  • Success Response:

    • Status: 200

    • Content:

      { "message": "Order status received." }

Contributors