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

Allow users to subscribe to blog updates #99

Open
dennyabrain opened this issue Jan 17, 2023 · 1 comment
Open

Allow users to subscribe to blog updates #99

dennyabrain opened this issue Jan 17, 2023 · 1 comment

Comments

@dennyabrain
Copy link
Contributor

Prior Research :

We use Mailchimp to host our mailing list. Mailchimp has Audience
A recommended way to segment your audience is using tags. You can create a signup form and set a tag called "blog" to it. You can embed this form on tattle.co.in/blog. Whenever a user subscribes via this form, an entry will be made of their email address in the Audience list and a tag "blog" will be associated with this user. You can then filter your audience by tag to target just these people.

Embeddable Code

I created a new form and associated the tag "Blog" to it. This should be ready to embed on our website

<!-- Begin Mailchimp Signup Form -->
<link href="//cdn-images.mailchimp.com/embedcode/classic-071822.css" rel="stylesheet" type="text/css">
<style type="text/css">
	#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif;  width:600px;}
	/* Add your own Mailchimp form style overrides in your site stylesheet or in this style block.
	   We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. */
</style>
<div id="mc_embed_signup">
    <form action="https://app.us19.list-manage.com/subscribe/post?u=a9af83af1f247ecc04f50ad46&amp;id=4afc4a2c79&amp;f_id=003a91e4f0" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_self">
        <div id="mc_embed_signup_scroll">
        <h2>Subscribe </h2>
        <div class="indicates-required"><span class="asterisk">*</span> indicates required</div>
<div class="mc-field-group">
	<label for="mce-EMAIL">Email Address  <span class="asterisk">*</span>
</label>
	<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" required>
	<span id="mce-EMAIL-HELPERTEXT" class="helper_text"></span>
</div>
<div hidden="true"><input type="hidden" name="tags" value="6638789"></div>
	<div id="mce-responses" class="clear foot">
		<div class="response" id="mce-error-response" style="display:none"></div>
		<div class="response" id="mce-success-response" style="display:none"></div>
	</div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
    <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_a9af83af1f247ecc04f50ad46_4afc4a2c79" tabindex="-1" value=""></div>
        <div class="optionalParent">
            <div class="clear foot">
                <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="button">
                <p class="brandingLogo"><a href="http://eepurl.com/iiuKOf" title="Mailchimp - email marketing made easy and fun"><img src="https://eep.io/mc-cdn-images/template_images/branding_logo_text_dark_dtp.svg"></a></p>
            </div>
        </div>
    </div>
</form>
</div>

<!--End mc_embed_signup-->
@dennyabrain
Copy link
Contributor Author

I edited the code a bit to work with react

<div id="mc_embed_signup">
            <form
              action="https://app.us19.list-manage.com/subscribe/post?u=a9af83af1f247ecc04f50ad46&amp;id=4afc4a2c79&amp;f_id=003a91e4f0"
              method="post"
              id="mc-embedded-subscribe-form"
              name="mc-embedded-subscribe-form"
              class="validate"
              target="_self"
            >
              <div id="mc_embed_signup_scroll">
                <h2>Subscribe </h2>
                <div class="indicates-required">
                  <span class="asterisk">*</span> indicates required
                </div>
                <div class="mc-field-group">
                  <label for="mce-EMAIL">
                    Email Address <span class="asterisk">*</span>
                  </label>
                  <input
                    type="email"
                    value=""
                    name="EMAIL"
                    class="required email"
                    id="mce-EMAIL"
                    required
                  />
                  <span id="mce-EMAIL-HELPERTEXT" class="helper_text"></span>
                </div>
                <div hidden="true">
                  <input type="hidden" name="tags" value="6638789" />
                </div>
                <div id="mce-responses" class="clear foot">
                  <div
                    class="response"
                    id="mce-error-response"
                    style={{ display: "none" }}
                  ></div>
                  <div
                    class="response"
                    id="mce-success-response"
                    style={{ display: "none" }}
                  ></div>
                </div>
                <div
                  style={{ position: "absolute", left: "-5000px" }}
                  aria-hidden="true"
                >
                  <input
                    type="text"
                    name="b_a9af83af1f247ecc04f50ad46_4afc4a2c79"
                    tabindex="-1"
                    value=""
                  />
                </div>
                <div class="optionalParent">
                  <div class="clear foot">
                    <input
                      type="submit"
                      value="Subscribe"
                      name="subscribe"
                      id="mc-embedded-subscribe"
                      class="button"
                    />
                    <p class="brandingLogo">
                      <a
                        href="http://eepurl.com/iiuKOf"
                        title="Mailchimp - email marketing made easy and fun"
                      >
                        <img src="https://eep.io/mc-cdn-images/template_images/branding_logo_text_dark_dtp.svg" />
                      </a>
                    </p>
                  </div>
                </div>
              </div>
            </form>
          </div>

It needs more tweaking to make the styling work. Or maybe there's a better solution.
In the past we've embedded a mailchimp subscribe form with custom Tattle style using a react-mailchimp-subscribe component
(https://github.com/tattle-made/website/blob/master/src/components/atomic/MailchimpSubscribeForm.js)
We could read that component's source code to figure out how its done.

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

1 participant