PHP Classes

File: README.md

Recommend this page to a friend!
  Classes of Ahmad Mustapha   Inisev Sub PHP Email API   README.md   Download  
File: README.md
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Inisev Sub PHP Email API
API to manage newsletter subscriptions
Author: By
Last change:
Date: 2 years ago
Size: 1,290 bytes
 

Contents

Class file image Download

Inisev Email Subscription

Email subscription system

Installation

Clone repo

git clone git@github.com:ahmard/inisev-sub.git

Install composer packages

composer install

Generate app secret key

php artisan key:generate

Edit .env file to provide necessary config

Run migrations

php artisan migrate --seed

Usage

Start the server

php artisan serve

You will then send json payload to each below endpoints.<br/> I use PhpStorm to send request to the endpoints, you can find the request config here

Create User

POST http://localhost:8000/api/users

{
    "name": "Jane",
    "email": "jane@anonym.net",
    "password": "1234"
}

Create Website

POST http://localhost:8000/api/websites

{
    "user": 1,
    "website_name": "Inisev",
    "website_domain": "inisev.com"
}

Create Post

POST http://localhost:8000/api/websites/posts

{
    "user": 1,
    "post_title": "Post Number 1",
    "post_content": "Post content should be here"
}

Make Subscription

POST http://localhost:8000/api/websites/subscriptions

{
    "user": 1,
    "website": 1
}

Sending Email

Execute below command to send email to subscribers

php artisan subs:send --post=1 --site=1