<?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: Arpit Gupta</title>
    <description>The latest articles on DEV Community by Arpit Gupta (@gigaarpit).</description>
    <link>https://dev.to/gigaarpit</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%2F1215251%2Fcaca3b1a-4df5-4fdc-9233-beaa373a5ebb.jpg</url>
      <title>DEV Community: Arpit Gupta</title>
      <link>https://dev.to/gigaarpit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gigaarpit"/>
    <language>en</language>
    <item>
      <title>Mail to Blog: Publish to Blog using Email</title>
      <dc:creator>Arpit Gupta</dc:creator>
      <pubDate>Sun, 08 Jun 2025 23:11:52 +0000</pubDate>
      <link>https://dev.to/gigaarpit/mail-to-blog-publish-to-blog-using-email-3imn</link>
      <guid>https://dev.to/gigaarpit/mail-to-blog-publish-to-blog-using-email-3imn</guid>
      <description>&lt;p&gt;(This is a submission for the &lt;a href="https://dev.to/challenges/postmark"&gt;Postmark Challenge: Inbox Innovators&lt;/a&gt;).&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Mail to Blog&lt;/em&gt; is a streamlined workflow that allows users to publish blog posts directly via email. There's no need to log into a CMS dashboard or use any third-party application. Simply send an email where the subject becomes the post title and the body becomes the content. The post is published within seconds.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;'Mail to Blog' GitHub Repo: &lt;a href="https://github.com/gigaArpit/mail-to-blog" rel="noopener noreferrer"&gt;https://github.com/gigaArpit/mail-to-blog&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;A demo blog built on this workflow: &lt;a href="https://quotes.microgeek.dev/" rel="noopener noreferrer"&gt;https://quotes.microgeek.dev/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;GitHub repo of the demo blog: &lt;a href="https://github.com/gigaArpit/quotes" rel="noopener noreferrer"&gt;https://github.com/gigaArpit/quotes&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Postmark: Inbound email parsing&lt;/li&gt;
&lt;li&gt;Hugo + GitHub: Static site generator and hosting&lt;/li&gt;
&lt;li&gt;Cloudflare Workers: Receives parsed email data, converts to Markdown, commits to GitHub&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F9b0g8v87kd2edr1r7e4r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F9b0g8v87kd2edr1r7e4r.png" alt="workflow" width="800" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  One-Time Setup
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Hugo Site
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Create a new GitHub repository.&lt;/li&gt;
&lt;li&gt;Clone it locally.&lt;/li&gt;
&lt;li&gt;Initialize a Hugo site, configure a theme, and set up GitHub Actions for automatic deployment.&lt;/li&gt;
&lt;li&gt;Using Hugo is totally optional. You can use any static site generator like Jekyll etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For convenience, a sample Hugo setup with pre-configured theme and GitHub Actions is &lt;a href="https://github.com/gigaArpit/sample-hugo-site" rel="noopener noreferrer"&gt;available here&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generate GitHub Token
&lt;/h3&gt;

&lt;p&gt;Visit &lt;a href="https://github.com/settings/personal-access-tokens/new" rel="noopener noreferrer"&gt;this link&lt;/a&gt; to create a personal access token with the following configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Repository Access: Restrict to the above repository&lt;/li&gt;
&lt;li&gt;Permissions: Contents → Read and Write&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fe7zgd1ey7c9f6z6vg98b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fe7zgd1ey7c9f6z6vg98b.png" alt="GitHub Token Configuration" width="800" height="754"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloudflare Worker
&lt;/h3&gt;

&lt;p&gt;Sign-up for Cloudflare Workers, and create a new worker from the web interface. Use &lt;a href="https://github.com/gigaArpit/mail-to-blog/blob/main/worker.js" rel="noopener noreferrer"&gt;this sample script&lt;/a&gt;, which does the following things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Accepts &lt;code&gt;POST&lt;/code&gt; requests from Postmark's inbound webhook&lt;/li&gt;
&lt;li&gt;Converts the parsed email content to Markdown&lt;/li&gt;
&lt;li&gt;Commits a new post to GitHub using your personal access token&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't forget to modify the above sample script by entering correct GitHub username and repo name etc. (see instructions at the script end).&lt;/p&gt;

&lt;p&gt;Once deployed the Worker script, record its URL for later use. Try opening this URL in browser, and you should get &lt;code&gt;Method Not Allowed&lt;/code&gt; error, as it receives only &lt;code&gt;POST&lt;/code&gt; requests.&lt;/p&gt;

&lt;p&gt;Go to its Settings, and under the "Variables and Secrets", save a new environment variable with name &lt;code&gt;GITHUB_TOKEN&lt;/code&gt;, and value as your GitHub access token created in previous step.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fag5777qp5tioy77zs53a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fag5777qp5tioy77zs53a.png" alt="Cloudflare Worker Environment Variable Setup" width="800" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Postmark
&lt;/h3&gt;

&lt;p&gt;Postmark handles inbound email parsing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It assigns you an address like &lt;code&gt;yourhash@inbound.postmarkapp.com&lt;/code&gt; (customizable with your custom domain).&lt;/li&gt;
&lt;li&gt;It parses incoming emails into structured JSON.&lt;/li&gt;
&lt;li&gt;It sends this JSON to your configured webhook (the above Cloudflare Worker).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Steps to configure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up for Postmark, Create a server&lt;/li&gt;
&lt;li&gt;In the Inbound settings, set the webhook URL to your Worker&lt;/li&gt;
&lt;li&gt;Note your unique inbound email address&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Feyjq7070bz79oa23bz1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Feyjq7070bz79oa23bz1v.png" alt="Postmark Inbound Settings" width="800" height="589"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The free tier includes 100 inbound emails/month, which should be enough for most individuals. You can upgrade for paid plans if planning to extend this idea.&lt;/p&gt;

&lt;h2&gt;
  
  
  Publishing
&lt;/h2&gt;

&lt;p&gt;After completing above one-time setup:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Send an email to your Postmark inbound address&lt;/li&gt;
&lt;li&gt;Postmark parses and forwards the content to Cloudflare Worker&lt;/li&gt;
&lt;li&gt;The Worker pushes a Markdown file to your GitHub repo, with email subject as the post title; and email body as the post content&lt;/li&gt;
&lt;li&gt;GitHub Actions rebuild the Hugo site, and deploys to Cloudflare Pages platform&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Your new post will appear on the live site within minutes.&lt;/p&gt;

&lt;p&gt;You can share your Postmark inbound address with your friends and family, and easily start a group blog too.&lt;/p&gt;

&lt;h2&gt;
  
  
  Postmark Experience
&lt;/h2&gt;

&lt;p&gt;Integrating Postmark’s inbound email parsing into my pipeline was frictionless. The webhook configuration was immediate, and the inbound stream began delivering structured JSON without requiring custom MIME parsing or manual sanitation. The payload included all critical fields—subject, sender, body, attachments with consistent formatting that held up across test cases.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>postmarkchallenge</category>
      <category>cloudflare</category>
      <category>hugo</category>
    </item>
  </channel>
</rss>
