Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Newsletter signup form #125

Open
nickoneill opened this issue Jan 24, 2025 · 1 comment
Open

Add Newsletter signup form #125

nickoneill opened this issue Jan 24, 2025 · 1 comment
Assignees

Comments

@nickoneill
Copy link
Member

We have a very popular newsletter signup form on iOS that appears above the list of issues. Let's do the same thing on android.

This form appears by default for new users and can be dismissed immediately with the "no thanks" button, or if a user submits their email.

Some features:

  • dismiss button that prevents the form from showing again
  • some basic email validation
  • replace the subhead text with an error if the email is invalid or there's another problem sending the email

Here's the POST request code for submitting the email in swift, we should do the same but replace the tag with android:

var req = URLRequest(url: URL(string: "https://buttondown.com/api/emails/embed-subscribe/5calls")!)
req.httpMethod = "POST"
req.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
req.httpBody = "email=\(email)&tag=ios".data(using: .utf8)
URLSession.shared.dataTask(with: req).resume()

Here's what a few form states look like on iOS:

Image
@dektar dektar self-assigned this Feb 3, 2025
@dektar
Copy link
Collaborator

dektar commented Feb 4, 2025

Screenshots of how this could look before and during scroll. I haven't yet wired it in to make the newsletter POST request.

Image
Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants