Skip to content

rjt007/Email-Campaign-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Email Campaign Manager API

The Email Campaign Manager API is a Django-based RESTful API that allows you to manage subscribers, campaigns, and send daily email campaigns using SMTP or an external service like Mailgun.

Endpoints

Subscribers

  • Add Subscriber

    • Endpoint: /api/subscribers/
    • Method: POST
    • Description: Add a new subscriber to the system.
    • Request Body:
      {
          "email": "user@example.com",
          "first_name": "example"
      }
    • Response:
      • HTTP Status: 201 Created
  • Unsubscribe Subscriber

    • Endpoint: /api/subscribers/{subscriber_id}/unsubscribe/
    • Method: PUT
    • Description: Unsubscribe a user by marking them as inactive.
    • Response:
      • HTTP Status: 200 OK
      • Response Body: {"message": "user unsubscribed succesfully!"}

Campaigns

  • Add Campaign
    • Endpoint: /api/campaigns/
    • Method: POST
    • Description: Add a new campaign to the system.
    • Request Body:
      {
          "subject": "Campaign Subject",
          "preview_text": "Preview Text",
          "article_url": "https://example.com/article",
          "html_content": "<p>...</p>",
          "plain_text_content": "Text content..",
          "published_date": "2023-09-08"
      }
    • Response:
      • HTTP Status: 201 Created

Usage

To use this API, you can make HTTP requests to the specified endpoints using tools such as Insomnia, Postman, or Python's requests library.

Additional Features

  • Used Django Rest Framework for building RESTful endpoints.
  • Created a custom management command for creating email campaigns.
  • Intergarted an external email service Mailgun for sending campaigns daily.
  • Used Celery and Celery Beat for asynchronous email campaign scheduling.
  • Used Redis as a message broker for Celery.

Releases

No releases published

Packages

No packages published