<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: MD. Jahid Hasan</title>
    <description>The latest articles on DEV Community by MD. Jahid Hasan (@developerjahid).</description>
    <link>https://dev.to/developerjahid</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F316929%2F64363449-1048-4cd3-a9a7-9130d3ba184e.png</url>
      <title>DEV Community: MD. Jahid Hasan</title>
      <link>https://dev.to/developerjahid</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/developerjahid"/>
    <language>en</language>
    <item>
      <title>Gatsby &amp; Mailchimp integrations Easy way</title>
      <dc:creator>MD. Jahid Hasan</dc:creator>
      <pubDate>Tue, 14 Jan 2020 06:57:59 +0000</pubDate>
      <link>https://dev.to/developerjahid/gatsby-mailchimp-integrations-easy-way-1omm</link>
      <guid>https://dev.to/developerjahid/gatsby-mailchimp-integrations-easy-way-1omm</guid>
      <description>&lt;h2&gt;
  
  
  Email signup forms with Gatsby &amp;amp; Mailchimp
&lt;/h2&gt;

&lt;p&gt;In the article, I'll provide sample code to creating a Mailchimp signup form for Gatsby.&lt;/p&gt;

&lt;p&gt;Demo Link: &lt;a href="https://gatsbymailchimp.netlify.com/"&gt;https://gatsbymailchimp.netlify.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Images:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5z2OHnLV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/3zJXVcB/Screenshot-619.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5z2OHnLV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/3zJXVcB/Screenshot-619.png" alt="gatsby-mailchimp"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install the plugin&lt;/strong&gt; &lt;br&gt;
Install the plugin to get it working on your machine:&lt;br&gt;
&lt;br&gt;
 &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i gatsby-plugin-mailchimp
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Add the plugin to your Gatsby config file&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  resolve: 'gatsby-plugin-mailchimp',
  options: {
    endpoint: 'Copy the endpoint link from Mailchimp',
  },
},
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Images:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--5yN_5D5b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/jbMXN18/Screenshot-618.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--5yN_5D5b--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://i.ibb.co/jbMXN18/Screenshot-618.png" alt="gatsby-mailchimp"&gt;&lt;/a&gt;&lt;br&gt;
Copy the action link paste it to the endpoint.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Component Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;state = {
    nam1: null,
    nam2: null,
    email: null,
}
_handleChange = (e) =&amp;gt; {
    console.log({
        [`${e.target.name}`]: e.target.value,
    });
    this.setState({
        [`${e.target.name}`]: e.target.value,
    });
}
_handleSubmit = (e) =&amp;gt; {
    e.preventDefault();
console.log('submit', this.state);
addToMailchimp(this.state.email, {
            FIRSTNAME: this.state.nam1,
            LASTNAME: this.state.nam2
        })
        .then(({
            msg,
            result
        }) =&amp;gt; {
            console.log('msg', `${result}: ${msg}`);
if (result !== 'success') {
                throw msg;
            }
            alert(msg);
        })
        .catch((err) =&amp;gt; {
            console.log('err', err);
            alert(err);
        });
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Need Any Help&lt;/strong&gt;&lt;br&gt;
Contact: &lt;a href="mailto:contact@developerjahid.com"&gt;contact@developerjahid.com&lt;/a&gt;&lt;br&gt;
Make your modern website with Developer Jahid,&lt;br&gt;
Website: &lt;a href="https://developerjahid.com"&gt;https://developerjahid.com&lt;/a&gt;&lt;br&gt;
Thanks.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
