Email collection #38

Closed
opened 2018-05-09 16:12:17 +02:00 by kauffj · 5 comments
kauffj commented 2018-05-09 16:12:17 +02:00 (Migrated from github.com)

I'd like there to be a component that supports email collection and adds them to our user database tagged "developer". I say component because I'm not sure exactly where on the site this will live.

Adding the user to our database is relatively simple. Just POST the values email and tag=developer to api.lbry.io/list/subscribe. You can see PHP example code here: https://github.com/lbryio/lbry.io/blob/master/lib/thirdparty/LBRY.class.php#L20.

I'd like there to be a component that supports email collection and adds them to our user database tagged "developer". I say component because I'm not sure exactly where on the site this will live. Adding the user to our database is relatively simple. Just `POST` the values `email` and `tag=developer` to `api.lbry.io/list/subscribe`. You can see PHP example code here: https://github.com/lbryio/lbry.io/blob/master/lib/thirdparty/LBRY.class.php#L20.
Krisseck commented 2018-05-17 14:32:41 +02:00 (Migrated from github.com)

For now, I added the email component to the footer of every page, this can be of course changed easily.
Subscribing does not work currently because the LBRY API endpoint does not have correct CORS headers. @kauffj, who can I ask about this?

For now, I added the email component to the footer of every page, this can be of course changed easily. Subscribing does not work currently because the LBRY API endpoint does not have correct CORS headers. @kauffj, who can I ask about this?
kauffj commented 2018-05-17 15:03:59 +02:00 (Migrated from github.com)

Filed here though you might not be able to see it https://github.com/lbryio/internal-apis/issues/336

Most likely @nikooo777 will tackle, but whoever does will let you know. Expected to be done this week.

Filed here though you might not be able to see it https://github.com/lbryio/internal-apis/issues/336 Most likely @nikooo777 will tackle, but whoever does will let you know. Expected to be done this week.
tiger5226 commented 2018-05-17 16:31:10 +02:00 (Migrated from github.com)

@Krisseck The api-server should support CORS. This can be enabled I believe by making sure you are setting the Origin in the headers.

https://github.com/lbryio/internal-apis/blob/master/app/actions/server.go#L70-L74

As long as its there it will allow it.

Let me know if you are in fact setting this header setting and it is still not working. Ideally we can avoid completely open origin access by just making sure the origin is set.

@Krisseck The api-server should support CORS. This can be enabled I believe by making sure you are setting the `Origin` in the headers. https://github.com/lbryio/internal-apis/blob/master/app/actions/server.go#L70-L74 As long as its there it will allow it. Let me know if you are in fact setting this header setting and it is still not working. Ideally we can avoid completely open origin access by just making sure the origin is set.
Krisseck commented 2018-05-17 17:22:15 +02:00 (Migrated from github.com)

@tiger5226 thanks for the comment, I got this sorted already.
The problem was that the ajax library I was using sent the POST fields in JSON format in the body and it set a content-type header for this. I changed it to send the POST field as regular POST fields thus removing that extra content-type header that was not accepted by the API.

@tiger5226 thanks for the comment, I got this sorted already. The problem was that the ajax library I was using sent the POST fields in JSON format in the body and it set a content-type header for this. I changed it to send the POST field as regular POST fields thus removing that extra content-type header that was not accepted by the API.
tiger5226 commented 2018-05-17 17:26:01 +02:00 (Migrated from github.com)

Perfect, nice find!! Let me know if you need anything else.

Perfect, nice find!! Let me know if you need anything else.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry.tech#38
No description provided.