Email collection #38
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
campaign-blocker
consider soon
Content
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry.tech#38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 valuesemail
andtag=developer
toapi.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.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?
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.
@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.
@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.
Perfect, nice find!! Let me know if you need anything else.