Capturing leads is essential for any SAAS business, and our Signup Component is engineered to do just that. Designed to fit seamlessly into your user journey, this feature allows you to collect visitor emails effectively. Whether it's a popup, a footer form, or an inline component within your content, you have the flexibility to place it where it makes the most impact. With easy integration into your email marketing software, you can start nurturing these leads into potential customers right away.
<.live_component module={MyAppWeb.Live.SignupComponent} id="signup-form" topic="some topic" />
Here, id
is a unique identifier for the component, and topic
is a string indicating what the signup is for, like "Newsletter" or "Special Offers."signups
table in your database, and a message will appear saying "You are successfully signed up!".You may wish to capture more than just an email and a topic. Here's how you can do it:
MyApp.Signups.Signup
schema.elixirfield :new_field, :string
changeset
function in the same module to cast and validate the new fields.elixir|> cast(attrs, [:email, :name, :phone, :topic, :signed_of_at, :new_field])
|> validate_required([:email, :topic, :new_field])
SignupComponent
LiveView, where the form is rendered.
The appearance and behavior of the Signup Component can be customized in the render
function in MyAppWeb.Live.SignupComponent
.
<.button>
tag in the render
function.placeholder
attribute in the <.input>
tag.<div class="py-2 font-semibold">
in the render
function.
If you want to have multiple sign-up forms targeting different audiences or offers, you can create instances of the component with different id
and topic
.
<.live_component module={MyAppWeb.Live.SignupComponent} id="newsletter-form" topic="Newsletter" />
<.live_component module={MyAppWeb.Live.SignupComponent} id="offers-form" topic="Special Offers" />
The Signup Component is not only powerful but also flexible. It allows for seamless integration and customization according to your needs, from capturing different types of user information to being placed wherever you see fit in your application.