Home Forums Newsletter Plugin Support Output the Newsletters with all info to REST API

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #238410
    alik
    Participant

    Hi Stefano,
    I am building the messaging system for our students in the University and I wondered, how do I output to REST API (JSON) all the newsletters that been sent in this format:

    {
      "newsletters": {
        "newsletter": [
          {
            "id": "1",
            "students_emails": "stud1@email.com, stud2@email.com, ...",
            "title": "NEWSLETTER TITLE",
            "contents": "BODY OF THE NEWSLETTER IN HTML",
            "list": "",
            "last_date": ""
          },
          { ... }
        ]
      }
    }

    Thank you!

    #238668
    Stefano
    Keymaster

    Hi, the "students_emails" attribute is the list of people which received the email?

    Anyway you should query and build a serializable structure (array of arrays or objects) getting all email from wp_newsletter_emails table and for students using the sent table.

    Stefano.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.