<?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: Cosmin Rusu</title>
    <description>The latest articles on DEV Community by Cosmin Rusu (@rusucosmin).</description>
    <link>https://dev.to/rusucosmin</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%2F243169%2Fb94b1db4-6a3b-4c18-bfd3-9419d924e69e.jpeg</url>
      <title>DEV Community: Cosmin Rusu</title>
      <link>https://dev.to/rusucosmin</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rusucosmin"/>
    <language>en</language>
    <item>
      <title>Emails Duty Labs</title>
      <dc:creator>Cosmin Rusu</dc:creator>
      <pubDate>Sun, 08 Dec 2019 11:30:44 +0000</pubDate>
      <link>https://dev.to/rusucosmin/emails-duty-labs-2811</link>
      <guid>https://dev.to/rusucosmin/emails-duty-labs-2811</guid>
      <description>&lt;p&gt;Check out my lastest blog article: rusu.io/emails. Hope you enjoy it.&lt;/p&gt;

&lt;p&gt;I just launched a new tool to help developers implement emails in their&lt;br&gt;
applications &lt;strong&gt;faster&lt;/strong&gt;. I've had to write email automations for more than&lt;br&gt;
4 clients until now.&lt;/p&gt;

&lt;p&gt;The usual conversation goes like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We want you to send a suite of emails whenever some events happen.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I write the first version of the emails.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;They want me to change the verbiage of almost all emails.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We iterate on that, we try to test the logic (which btw is very tricky and I usually&lt;br&gt;
change the email automation to wait a few minutes instead of a few days so we can test quickly)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We are satisfied with the implementation, but we don't quite have a way to test how&lt;br&gt;
well the implementation behaves in term of business returns - whether users bought&lt;br&gt;
something after we sent an email, whether they read the email, clicked the links,&lt;br&gt;
and so on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We come up with some hacks to measure the success.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;We are pretty much done.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After some time....&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;We want to add new emails/compaigns/change the verbiage.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Here we go again.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It quickly came into my brain that this is quite a common problem, and so, I did&lt;br&gt;
what any sane person would do and built and MVP in a few days. You can check it live&lt;br&gt;
at &lt;a href="https://emails.dutylabs.ro"&gt;https://emails.dutylabs.ro&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The app has two main parts: the dashboard and the API.&lt;/p&gt;
&lt;h1&gt;
  
  
  1. Dashboard
&lt;/h1&gt;

&lt;p&gt;Currently, the dashboard serves two main purposes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Activate your sending domains so that the app is able to send emails from these verified domains.&lt;br&gt;
For example, I activated my &lt;a href="https://dutylabs.ro"&gt;dutylabs.ro&lt;/a&gt; domain.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create email templates: basically you have a what-you-see-is-what-you-get interface&lt;br&gt;
where you define the body of the email you want to be delivered and you asign it a&lt;br&gt;
unique code. For example: the email &lt;strong&gt;welcome_email&lt;/strong&gt; with the body:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  Hi { {email} }`,

  We are thrilled to welcome you to our Uber for Pets app.

  We hope you enjoy it,

  Best,
  The Uber for Pets team
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You can also set the subject of the template and the default from-address.&lt;/p&gt;

&lt;p&gt;That's it! Now comes the fun part: the API integration.&lt;/p&gt;
&lt;h1&gt;
  
  
  2. API
&lt;/h1&gt;

&lt;p&gt;The API is a set of routes where you could trigger (and in the future - schedule)&lt;br&gt;
emails to be delivered to your customers.&lt;/p&gt;

&lt;p&gt;First, get your API Key from your dashboard account, and set it in the&lt;br&gt;
&lt;code&gt;X-Emails-Duty-Labs-Api-Key&lt;/code&gt; header.&lt;/p&gt;

&lt;p&gt;The simplest API call is the following:&lt;/p&gt;
&lt;h2&gt;
  
  
  End point
&lt;/h2&gt;


&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST https://emails.dutylabs.ro/api/v1/emails
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Body
&lt;/h2&gt;


&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "email": {
    "to_email": "send-to@dutylabs.ro",
    "template_code": "welcome_email"
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;You can also specify the &lt;strong&gt;subject&lt;/strong&gt; and the &lt;strong&gt;from_email&lt;/strong&gt; in the params to override the template&lt;br&gt;
default ones.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "email": {
    "to_email": "sendto@dutylabs.ro",
    "template_code": "welcome_email",
    "from_email": "another@dutylabs.ro",
    "subject": "Hello there"
  }
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Be sure to check out the &lt;a href="https://emails.dutylabs.ro/api/docs"&gt;API Docs&lt;/a&gt; to see&lt;br&gt;
more. If you are interested in trying out the API (for free), shoot me an email&lt;br&gt;
to &lt;code&gt;cosmin@dutylabs.ro&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I'm very excited about this launch as this fulfills one goal that I had in&lt;br&gt;
mind for a long time ago, which is to build a product that solves a pain. I'm&lt;br&gt;
sure many of us have this problem, and if not, I'm probably just gonna&lt;br&gt;
use this for my future clients and side projects.&lt;/p&gt;

&lt;p&gt;If you have any feedback, you know how to reach me - just be nice!&lt;/p&gt;

&lt;p&gt;Cheers 🥂,&lt;/p&gt;

&lt;p&gt;Cosmin&lt;/p&gt;

</description>
      <category>api</category>
      <category>emails</category>
      <category>automation</category>
      <category>customers</category>
    </item>
  </channel>
</rss>
