<?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: ES</title>
    <description>The latest articles on DEV Community by ES (@erkeen).</description>
    <link>https://dev.to/erkeen</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%2F578416%2Ff59fe346-8031-4bc6-8331-cd3d796557e1.jpeg</url>
      <title>DEV Community: ES</title>
      <link>https://dev.to/erkeen</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/erkeen"/>
    <language>en</language>
    <item>
      <title>How to Create Your Own Mailchimp Service?</title>
      <dc:creator>ES</dc:creator>
      <pubDate>Mon, 01 Mar 2021 14:27:46 +0000</pubDate>
      <link>https://dev.to/erkeen/how-to-create-your-own-mailchimp-service-37jd</link>
      <guid>https://dev.to/erkeen/how-to-create-your-own-mailchimp-service-37jd</guid>
      <description>&lt;p&gt;Mailchimp is often used to collect email lists. This post will teach you how to quickly create a Mailchimp-style email collection form. You can then start using it to collecting subscribers' emails.&lt;/p&gt;

&lt;h1&gt;
  
  
  Why build your own version of a Mailchimp form?
&lt;/h1&gt;

&lt;p&gt;There are a few reasons to do create your own Mailchimp style form, one is to remove the Mailchimp sponsor branding in your form. Sponsor branding free subscriber list forms are a paid-for feature with Mailchimp, and you may not want your subscribers to see third-party branding. Another reason is to avoid sharing user data with third parties. If you're going to take a privacy-minded approach with your services, it is good practice to avoid sharing user details with third parties wherever possible. &lt;/p&gt;

&lt;h1&gt;
  
  
  The "Supastack".
&lt;/h1&gt;

&lt;p&gt;I picked a stack with minimal setup, and which allows us to scale easily later without any stress.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next.js &lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Click here for more info&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Tailwind CSS &lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;Click here for more info&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Supabase &lt;a href="https://supabase.io/" rel="noopener noreferrer"&gt;Click here for more info&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt;&lt;/strong&gt; is a &lt;strong&gt;&lt;a href="https://reactjs.org/" rel="noopener noreferrer"&gt;React&lt;/a&gt;&lt;/strong&gt; based Front-End framework and it helps us to build a web page of Mailchimp.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://tailwindcss.com/" rel="noopener noreferrer"&gt;Tailwind CSS&lt;/a&gt;&lt;/strong&gt; is a utility-first CSS framework packed with classes. So, we don't have to create CSS styling classes, instead, we can just use ready-made Tailwind CSS classes directly in our HTML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://supabase.io/" rel="noopener noreferrer"&gt;Supabase&lt;/a&gt;&lt;/strong&gt; is a Backend-as-a-Service based on PostgreSQL Database. It provides not only a database but also Authentication, RESTfull APIs, a real-time database, and other back-end-related services (I'm also currently interning at Supabase!). &lt;/p&gt;

&lt;h1&gt;
  
  
  Let's create the project
&lt;/h1&gt;

&lt;p&gt;First of all, we need to sign up for an account with Supabase. You can sign up at &lt;a href="https://supabase.io/" rel="noopener noreferrer"&gt;Supabase.io&lt;/a&gt;. Once you have an account, create a new project and enter the following code in SQL Editor of the project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create table functions_emails (
  id bigint generated by default as identity primary key,
  name text,
  email_address text NOT NULL UNIQUE
);

-- This creates a table called functions_emails with id, name, and email_address columns.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wpcb5iv88kp7ba4ywe2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7wpcb5iv88kp7ba4ywe2.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Secondly, clone my &lt;a href="https://github.com/erkeen/mailchimp-starter" rel="noopener noreferrer"&gt;starter repository&lt;/a&gt; and open it with your Code Editor.&lt;/p&gt;

&lt;p&gt;Now, let's install the required dependencies by entering the following command on the terminal of the Code Editor:&lt;br&gt;
&lt;code&gt;npm install&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;We should now have everything set up. It is time to make the pieces together. Create a file called env.local to save Environment Variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NEXT_PUBLIC_SUPABASE_URL=SupabaseURL 

NEXT_PUBLIC_SUPABASE_KEY=SupabaseKEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;SupabaseURL&lt;/em&gt;&lt;/strong&gt; is a unique URL provide by Supabase to connect to your project database. You can find it in your project settings.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;SupabaseKEY&lt;/em&gt;&lt;/strong&gt; is a key provided by Supabase to access your project database. You can find it in your project settings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbmz3mn8mmvehacu2i7cz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbmz3mn8mmvehacu2i7cz.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, we can move on to &lt;code&gt;Form&lt;/code&gt; Component. I have already created the form except main functionality. Let's complete the component by modifying &lt;code&gt;handleSubmit(e)&lt;/code&gt; function:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Form.js
async function handleSubmit(e) {
    try {
      e.preventDefault();
      if (!email)
        throw new Error(
          "Email is required. Please provide a valid email address!"
        );
// Following code inserts data into the database.
      const { error } = await supabase.from(props.table).insert([
        {
          name,
          email_address: email,
        },
      ]);
      resetName();
      resetEmail();
      if (error) alert(error.details);
      if (!error) alert("You have successfully subscribed!");
    } catch (error) {
      alert(error.message);
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;Form&lt;/code&gt; Component should now be ready. We now have to add it into the index.js file in the pages folder by entering the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// index.js
import Form from "../components/Form/Form";

export default function Home() {
  return (
    &amp;lt;div className="dark"&amp;gt;
      &amp;lt;main&amp;gt;
        &amp;lt;Form table="functions_emails" title="Functions" /&amp;gt;
      &amp;lt;/main&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One final step is running the project by entering the following code in the terminal:&lt;br&gt;
&lt;code&gt;npm run dev&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;If it runs successfully, we can check the project by entering the &lt;code&gt;http://localhost:3000&lt;/code&gt; URL on our choice of browser. Now we have to submit the form by entering our name and email address.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7j6hxn4hox9865rwzurj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7j6hxn4hox9865rwzurj.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the form is submitted successfully, the data should be stored in the Supabase database.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fad194rkd80ihtu7r14c4.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fad194rkd80ihtu7r14c4.PNG" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you have made it this far, it means you have your own Mailchimp Service. Of course, you can customize it however you want and start using it.&lt;/p&gt;

&lt;p&gt;The final version of the project: &lt;a href="https://mailchimp.vercel.app/" rel="noopener noreferrer"&gt;https://mailchimp.vercel.app/&lt;/a&gt;&lt;br&gt;
The final version of the project Github Repository: &lt;a href="https://github.com/erkeen/mailchimp" rel="noopener noreferrer"&gt;https://github.com/erkeen/mailchimp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Thank you for your attention!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Qanday qilib Mailchimp xizmatini yaratish mumkin?</title>
      <dc:creator>ES</dc:creator>
      <pubDate>Mon, 15 Feb 2021 22:11:38 +0000</pubDate>
      <link>https://dev.to/erkeen/qanday-qilib-mailchimp-xizmatini-yaratish-mumkin-gn6</link>
      <guid>https://dev.to/erkeen/qanday-qilib-mailchimp-xizmatini-yaratish-mumkin-gn6</guid>
      <description>&lt;p&gt;Hozirgi kunda Mailchimp xizmati Marketing sohasini muhim qismiga aylanib borayotganiga shubha yo'q. Bugun sizlarga Mailchimp xizmatini tanishtirish barobarida, uni qanday qilib yaratish haqida shu maqolada yoritib beraman.&lt;/p&gt;

&lt;h2&gt;
  
  
  Mailchimp xizmati nima?
&lt;/h2&gt;

&lt;p&gt;Men avval boshidan Mailchimp xizmati Marketing sohasida o'z o'rniga egaligini bekorga eslatib o'tganim yo'q. Biz bilamizki Marketing - bu Reklama, shunday ekan Mailchimp xizmati Tijoratchilarga yoki Tadbirkorlarga o'z maxsulotlarini reklama qilishga yordam beradi. Mailchimp xizmati sizning maxsulotingizni email xabar orqali reklama qilishini taklif etadi, ya'ni, foydalanuvchilarning o'zlari yangi chiqayotgan maxsulotga yoki tayyor bo'lgan maxsulotning kutilayotgan yangiliklari uchun obuna bo'ladi va siz ularni o'z maxsulotingiz haqida xabardor qilasiz.&lt;/p&gt;

&lt;h2&gt;
  
  
  Endi birgalikda Mailchimp xizmatini yaratamiz.
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Bizga kerakli bo'ladigan dasturlar:
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Next.js &lt;a href="https://nextjs.org/"&gt;Next.js haqida to'liq ma'lumot&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Tailwind CSS &lt;a href="https://tailwindcss.com/"&gt;Tailwind CSS haqida to'liq ma'lumot&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Supabase &lt;a href="https://supabase.io/"&gt;Supabase haqida to'liq ma'lumot&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Albatta, sizda savol paydo bo'lishi mumkin, ya'ni, nega bizga bu dasturlar kerak?&lt;/p&gt;

&lt;p&gt;Keling unda, bu dasturlar haqida qisqa ma'lumot berib o'tay.&lt;br&gt;
Xullas, &lt;strong&gt;Next.js&lt;/strong&gt; - bu Front-End &lt;strong&gt;&lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt;&lt;/strong&gt; kutubxonasi asosida qurilgan framework va biz uni Web sahifasi yaratish uchun ishlatamiz.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tailwind CSS&lt;/strong&gt; - bu bizga kerakli bo'lgan CSS classlari bilan ta'minlab beradi va biz uni Web sahifamizni ko'rinishini bezatish uchun ishlatamiz.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Supabase&lt;/strong&gt; - bu bizga ma'lumotlar bazasi bilan taminlaydi va biz obunachilarning email manzillarini ma'lumotlar bazasiga saqlaymiz. Supabasening asosiy afzalligi shunadaki, biz Back-End dasturini yaratishimizga xojat qolmaydi.&lt;/p&gt;

&lt;p&gt;Endi loyihamizni yaratishni boshlasak ham bo'ladi.&lt;/p&gt;

&lt;p&gt;Birinchi navbatda Supabase web sahifasi orqali ro'yxatdan o'tamiz va yangi loyiha yaratamiz, keyin loyihaning SQL Editor bo'limiga quyidagi kodni kiritamiz:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;create table functions_emails (
  id bigint generated by default as identity primary key,
  name text,
  email_address text NOT NULL UNIQUE
);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Endi &lt;a href="https://github.com/erkeen/mailchimp-starter"&gt;boshlang'ich repository&lt;/a&gt; ni kopmyuterimizga yuklab olamiz va repositoryni terminal orqali ochib, quyidagi kod komandasini kiritamiz:&lt;br&gt;
&lt;code&gt;npm install&lt;/code&gt; &lt;br&gt;
Ushbu komanda bizga kerakli bo'lgan dasturlarni o'rnatadi.&lt;/p&gt;

&lt;p&gt;Keyin Repositoryni Code Editor orqali ochamiz va loyihaning asos qismiga &lt;code&gt;env.local&lt;/code&gt; faylini yaratib, quyidagi kodni kiritamiz:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NEXT_PUBLIC_SUPABASE_URL=SupabaseURL 

NEXT_PUBLIC_SUPABASE_KEY=SupabaseKEY
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;&lt;em&gt;SupabaseURL&lt;/em&gt;&lt;/strong&gt; - bu Supabase web sahifasida yaratgan loyihangizning sozlashlar bo'limidagi ilova (&lt;code&gt;URL&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;SupabaseKEY&lt;/em&gt;&lt;/strong&gt; - bu Supabase web sahifasida yaratgan loyihangizning sozlashlar bo'limidagi kalit (&lt;code&gt;anon&lt;/code&gt; &lt;code&gt;public&lt;/code&gt;)&lt;/p&gt;

&lt;p&gt;Endi navbat &lt;code&gt;Form&lt;/code&gt; Componentiga. &lt;code&gt;handleSubmit(e)&lt;/code&gt; funksiyasini quyidagi kod bilan o'zgartiramiz:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Form.js
async function handleSubmit(e) {
    try {
      e.preventDefault();
      if (!email)
        throw new Error(
          "Email is required. Please provide a valid email address!"
        );
      const { error } = await supabase.from(props.table).insert([
        {
          name,
          email_address: email,
        },
      ]);
      resetName();
      resetEmail();
      if (error) alert(error.details);
      if (!error) alert("You have successfully subscribed!");
    } catch (error) {
      alert(error.message);
    }
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Bizning &lt;code&gt;Form&lt;/code&gt; Componentimiz to'liq bo'ldi. Ushbu Componentdan foydalanish uchun &lt;code&gt;pages&lt;/code&gt; papkasidagi &lt;code&gt;index.js&lt;/code&gt; fayliga quyidagi kodlarni kiritamiz:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// index.js
import Form from "../components/Form/Form";

export default function Home() {
  return (
    &amp;lt;div className="dark"&amp;gt;
      &amp;lt;main&amp;gt;
        &amp;lt;Form table="functions_emails" title="Functions" /&amp;gt;
      &amp;lt;/main&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Endi loyihamizni tekshirib ko'ramiz. Avval terminalga quyidagi kod komandasini kiritamiz:&lt;br&gt;
&lt;code&gt;npm run dev&lt;/code&gt; &lt;br&gt;
Ushbu komanda loyihani o'z kopmyuterimizda ishlatishga imkon beradi.&lt;/p&gt;

&lt;p&gt;Va nihoyat Browserda &lt;code&gt;http://localhost:3000&lt;/code&gt; ilovasi orqali yaratgan loyihamizning web sahifasini ochamiz, &lt;code&gt;Form&lt;/code&gt; ga o'z ismimiz va email manzilimiz kiritamiz. Endi Supabase ma'lumotlar bazasini tekshiramiz, agar biz kiritgan ma'lumotlar Supabase ma'lumotlar bazasida saqlangan bo'lsa, u holda bizning Mailchimp loyihamiz tayyor deb atasak ham bo'ladi.&lt;/p&gt;

&lt;p&gt;Siz ushbu Mailchimp loyihasini takomillashtirishingiz va omma e'tiboriga havola etishingiz mumkin.&lt;/p&gt;

&lt;p&gt;Loyihaning so'nggi versiyasi: &lt;a href="https://mailchimp.vercel.app/"&gt;https://mailchimp.vercel.app/&lt;/a&gt;&lt;br&gt;
Loyihaning so'nggi Github Repositoriysi: &lt;a href="https://github.com/erkeen/mailchimp"&gt;https://github.com/erkeen/mailchimp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;E'tiboringiz uchun raxmat.&lt;/p&gt;

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