jazzband / django-newsletter

An email newsletter application for the Django web application framework, including an extended admin interface, web (un)subscription, dynamic e-mail templates, an archive and HTML email support.
GNU Affero General Public License v3.0
846 stars 204 forks source link

Unable to call the subscribe api using Axios in React frontend #377

Open eakenbor opened 2 years ago

eakenbor commented 2 years ago

Calling the url "//subscribe/" using axios from a React frontend does not work when the user is not authenticated. However, it works on Postman when using form-data instead of the request body.

Here is my code:

const formData = new FormData()
formData .append("email_field", "example@email.com)
axios.post("/<general-newsletter/subscribe/", formData )

On sending, nothing happens in the backend instead of registering the email as an unactivated subscription.

Please can someone help me with this?