<?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: Prosenjit Manna</title>
    <description>The latest articles on DEV Community by Prosenjit Manna (@prosenjitmanna).</description>
    <link>https://dev.to/prosenjitmanna</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%2F283979%2F4cdb3e80-dff7-4e12-92ac-e3a09015a318.jpeg</url>
      <title>DEV Community: Prosenjit Manna</title>
      <link>https://dev.to/prosenjitmanna</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prosenjitmanna"/>
    <language>en</language>
    <item>
      <title>Search emails with node-imap</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Tue, 26 Nov 2024 07:46:29 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/search-emails-with-imap-32ej</link>
      <guid>https://dev.to/prosenjitmanna/search-emails-with-imap-32ej</guid>
      <description>&lt;p&gt;Why Needed emails search with IMAP. Because of the limitation of UI basis search can be slow and others tools like mailinator, maildrops are sometimes slow and not accurately work as expected. &lt;/p&gt;

&lt;p&gt;So why actually needs email search functionalities in automation? I want to implement signup verification features tested with automation. So once someone signup with automation I have to check email for new email and signup tokens for verification. &lt;/p&gt;

&lt;p&gt;So I used node-imap and hostinger.in email provider because Gmail and Outlook they don't provide Imap &lt;/p&gt;

&lt;p&gt;So I used node-imap npm package to active this and here is the code&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Imap, { Config } from 'node-imap';
import { appEnv } from './app-env';

const imapConfig: Config = {
  user: appEnv.IMAP_USER,
  password: appEnv.IMAP_PASSWORD,
  host: appEnv.IMAP_HOST,
  port: appEnv.IMAP_PORT,
  tls: appEnv.IMAP_TLS,
};

interface Message {
  seqno: number;
  attributes: any;
  body: string;
}

export const readEmails = ({ searchDate }: { searchDate: string }): Promise&amp;lt;Message[]&amp;gt; =&amp;gt; {
  return new Promise((resolve, reject) =&amp;gt; {
    const imap = new Imap(imapConfig);
    const messages: Message[] = [];

    imap.once('ready', () =&amp;gt; {
      // console.log('imap ready');

      imap.openBox('INBOX', true, (err, box) =&amp;gt; {
        if (err) {
          imap.end();
          return reject(err);
        }
        // console.log('total', box.messages.total);

        imap.search(['ALL', ['SINCE', searchDate]], (err, results) =&amp;gt; {
          if (err) {
            imap.end();
            return reject(err);
          }

          const fetch = imap.fetch(results, { bodies: '' });

          fetch.on('message', (msg: any, seqno: number) =&amp;gt; {
            // console.log('Message #%d', seqno);
            const prefix = '(#' + seqno + ') ';
            let messageBody = '';

            msg.on('body', (stream: any) =&amp;gt; {
              let buffer = '';
              stream.on('data', (chunk: any) =&amp;gt; {
                buffer += chunk.toString('utf8');
              });
              stream.on('end', () =&amp;gt; {
                messageBody = buffer;
                // console.log(prefix + 'Body [%s]', buffer);
              });
            });

            msg.once('attributes', (attrs: any) =&amp;gt; {
              messages.push({
                seqno,
                attributes: attrs,
                body: messageBody,
              });
            });

            msg.once('end', () =&amp;gt; {
              // console.log(prefix + 'Finished');
            });
          });

          fetch.once('error', (err) =&amp;gt; {
            console.error('Fetch error:', err);
            imap.end();
            reject(err);
          });

          fetch.once('end', () =&amp;gt; {
            // console.log('Done fetching all messages!');
            // console.log('Fetched messages:', messages);
            imap.end();
            resolve(messages);
          });
        });
      });
    });

    imap.once('error', (err: Error) =&amp;gt; {
      console.error('IMAP error:', err.message);
      reject(err);
    });

    imap.once('end', () =&amp;gt; {
      // console.log('Connection ended');
    });

    imap.connect();
  });
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This function is re-usable. And here is the callback&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;readEmails({ searchDate: 'Nov 24, 2024'})
  .then((messages) =&amp;gt; {
    console.log('Done fetching all messages!', messages.length);
    console.log('Fetched messages:', messages);
  })
  .catch((err) =&amp;gt; {
    console.error('Error fetching messages:', err);
  });

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>automation</category>
      <category>testing</category>
    </item>
    <item>
      <title>Why I create a youtube chanel</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Sun, 02 Oct 2022 13:18:31 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/why-i-create-a-youtube-chanel-44n0</link>
      <guid>https://dev.to/prosenjitmanna/why-i-create-a-youtube-chanel-44n0</guid>
      <description>&lt;p&gt;Before come to conclussion, I must say, I really like technologies, computer, internet.&lt;/p&gt;

&lt;p&gt;Everyone needs opportunity to express feelings of happyness, sadness, emotions, skills.&lt;/p&gt;

&lt;p&gt;Social media do the first thing, with facebook whatsapp most of the people express their happiness. They spend lot of time in facebook, instagram and other social media. &lt;/p&gt;

&lt;p&gt;Even myself also spending time earlier in social media, playing game. But over time it feels like someone always saying, you are wasting time in social media, and playing game. &lt;/p&gt;

&lt;p&gt;You know, when I started using computer, I played computer game over 10 hours per day. But somehow I know my primary goal. So, I tried to put my best effort where needed. &lt;/p&gt;

&lt;p&gt;And now I confident about my career, about my skills. So aprt of my work, I have need to do some things that is related to technologies. But it should be different from professional work, computer gamminng, seeing continuieus web episodes in different ott platform. &lt;/p&gt;

&lt;p&gt;So, over the time I attached to making content creation process in youtube. My primary motive is, It should not feel after 5 hours of work that I am wasting my time. Also, need some audience because of without audience, I can not motivate myself. And you know when I record my screens, that someone will watch this video. So I train myself for better fluency in speaking. &lt;/p&gt;

&lt;p&gt;Over the time, I likes video editing, captering different scene, spend some money for purchasing different tool and I think it becoming passion for me. &lt;/p&gt;

&lt;p&gt;Visit my chanel: &lt;a href="https://www.youtube.com/channel/UCT_TFxOJPqVId32HQifN-Mw" rel="noopener noreferrer"&gt;https://www.youtube.com/channel/UCT_TFxOJPqVId32HQifN-Mw&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>React Starter Template</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Sun, 03 Jul 2022 17:27:51 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/react-starter-template-37l7</link>
      <guid>https://dev.to/prosenjitmanna/react-starter-template-37l7</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/OgUUyPXXbCg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Features of this starter template&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Typescript, Husky, eslint configured&lt;/li&gt;
&lt;li&gt;Staged lint &lt;/li&gt;
&lt;li&gt;Router dom with initial routes &lt;/li&gt;
&lt;li&gt;CSS library Tailwind installed &lt;/li&gt;
&lt;li&gt;SCSS added &lt;/li&gt;
&lt;li&gt;and many more&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Repo: &lt;a href="https://github.com/itobuztech/react-starter-template" rel="noopener noreferrer"&gt;https://github.com/itobuztech/react-starter-template&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React Starter Template to enhange and speedup project development&lt;/p&gt;

</description>
      <category>react</category>
    </item>
    <item>
      <title>Base Template | Base twig | Wordpress template system with timber</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Wed, 07 Jul 2021 05:11:08 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/base-template-base-twig-wordpress-template-system-with-timber-5cmg</link>
      <guid>https://dev.to/prosenjitmanna/base-template-base-twig-wordpress-template-system-with-timber-5cmg</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/MX9U40iHf1A"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>wordpress</category>
    </item>
    <item>
      <title>Wordpress Template hierarchy</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Mon, 05 Jul 2021 16:48:46 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/wordpress-template-hierarchy-3h9m</link>
      <guid>https://dev.to/prosenjitmanna/wordpress-template-hierarchy-3h9m</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/aVIrLqlyj2A"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>wordpress</category>
    </item>
    <item>
      <title>What is timber plugin and why it is required?</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Mon, 05 Jul 2021 03:55:42 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/what-is-timber-plugin-and-why-it-is-required-2ede</link>
      <guid>https://dev.to/prosenjitmanna/what-is-timber-plugin-and-why-it-is-required-2ede</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/pw-9exxbHOA"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>wordpress</category>
    </item>
    <item>
      <title>Reduce Web page size 70 to 80%</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Mon, 05 Jul 2021 03:51:18 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/reduce-web-page-size-70-to-80-3f7b</link>
      <guid>https://dev.to/prosenjitmanna/reduce-web-page-size-70-to-80-3f7b</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/JGcdQEjQfik"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>pagespeed</category>
    </item>
    <item>
      <title>Wordpress Tutorial With Timber video</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Sun, 04 Jul 2021 10:38:44 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/wordpress-tutorial-video-i4c</link>
      <guid>https://dev.to/prosenjitmanna/wordpress-tutorial-video-i4c</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/6TPpzpFt_sk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Playlist: &lt;br&gt;
&lt;a href="https://www.youtube.com/embed/videoseries?list=PL3gSMjdAtx33Z_Ox9QZN1-3O-rRvr4Df0" rel="noopener noreferrer"&gt;https://www.youtube.com/embed/videoseries?list=PL3gSMjdAtx33Z_Ox9QZN1-3O-rRvr4Df0&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>timber</category>
      <category>wptwig</category>
    </item>
    <item>
      <title>Wordpress install in EC2</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Sun, 16 May 2021 10:27:25 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/wordpress-install-in-ec2-2ohl</link>
      <guid>https://dev.to/prosenjitmanna/wordpress-install-in-ec2-2ohl</guid>
      <description>&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/UykiKBEMnYg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Topics of tutorial&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Aws instance create&lt;/li&gt;
&lt;li&gt;Apache installation&lt;/li&gt;
&lt;li&gt;Mysql installation&lt;/li&gt;
&lt;li&gt;Apache configure&lt;/li&gt;
&lt;li&gt;Php installation with few dependencies&lt;/li&gt;
&lt;li&gt;Wp CLI installation&lt;/li&gt;
&lt;li&gt;WordPress install&lt;/li&gt;
&lt;li&gt;Domain configure&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Wordpress Development With Timber</title>
      <dc:creator>Prosenjit Manna</dc:creator>
      <pubDate>Sat, 24 Apr 2021 16:12:24 +0000</pubDate>
      <link>https://dev.to/prosenjitmanna/wordpress-development-with-timber-51je</link>
      <guid>https://dev.to/prosenjitmanna/wordpress-development-with-timber-51je</guid>
      <description>&lt;p&gt;URL of the starter theme: &lt;br&gt;
&lt;a href="https://github.com/prosenjit-manna/wp-twig-public" rel="noopener noreferrer"&gt;https://github.com/prosenjit-manna/wp-twig-public&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Video
&lt;/h2&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/ruZ07PzgG8c"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Features included with this starter theme
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Stylesheet optimization &lt;/li&gt;
&lt;li&gt;Javascript optimization &lt;/li&gt;
&lt;li&gt;Gutenberg block generate with Lazy block plugin (Included with theme )&lt;/li&gt;
&lt;li&gt;Block specific stylesheet loading automatically only for used pages&lt;/li&gt;
&lt;li&gt;BLock specific Javascript loading automatically only for used pages&lt;/li&gt;
&lt;li&gt;Lazy loading images &lt;/li&gt;
&lt;li&gt;On the fly image resize&lt;/li&gt;
&lt;li&gt;Redux option panel added for theme option &lt;/li&gt;
&lt;li&gt;CMB2 added for page meta generate&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Development workspace features
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;.gitignore files added to removed common files from git &lt;/li&gt;
&lt;li&gt;Vscode common settings included to enforece indentation &lt;/li&gt;
&lt;li&gt;Deploy script added &lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>wordpress</category>
      <category>theme</category>
      <category>gutenberg</category>
    </item>
  </channel>
</rss>
